32 $sDir =
$myConfig->getConfigParam(
'sShopDir' ) .
'/documentation/admin';
34 $sAbbr = $oLang->getLanguageAbbr($oLang->getTplLanguage());
35 if ( $sAbbr ==
"de" ) {
38 if ( is_dir( $sDir ) ) {
39 $sDir =
$myConfig->getConfigParam(
'sShopURL' ) .
'documentation/admin';
44 $sDir =
"http://docu.oxid-esales.com/PE/{$oShop->oxshops__oxversion->value}/" . $iLang .
'/admin';
47 $this->_aViewData[
'sHelpURL'] = $sDir;
63 protected function _getTextEditor( $iWidth, $iHeight, $oObject, $sField, $sStylesheet = null )
65 if ( $this->_oEditor === null ) {
69 $sEditorPath =
'wysiwigpro';
70 $sEditorFile = getShopBasePath().
"core/".$sEditorPath .
'/wysiwygPro.class.php';
74 $this->_oEditor =
false;
76 if ( $sEditorFile && file_exists( $sEditorFile ) ) {
77 include_once $sEditorFile;
80 $this->_oEditor =
new wysiwygPro();
88 $this->_oEditor->editorURL = $sEditorUrl;
89 $this->_oEditor->urlFormat =
'preserve';
92 $this->_oEditor->documentDir = $this->_oEditor->imageDir =
$myConfig->getPictureDir(
false ).
'wysiwigpro/';
93 $this->_oEditor->documentURL = $this->_oEditor->imageURL =
$myConfig->getPictureUrl( null,
false ).
'wysiwigpro/';
96 $this->_oEditor->upload =
true;
99 $this->_oEditor->emptyValue =
"<p> </p>";
102 $this->_oEditor->deleteFiles =
true;
103 $this->_oEditor->deleteFolders =
true;
106 $this->_oEditor->allowedImageExtensions =
'.jpg, .jpeg, .gif, .png';
109 $this->_oEditor->allowedDocExtensions =
'.html, .htm, .pdf, .doc, .rtf, .txt, .xl, .xls, .ppt, .pps, .zip, .tar, .swf, .wmv, .rm, .mov, .jpg, .jpeg, .gif, .png';
112 $this->_oEditor->name = $sField;
116 $this->_oEditor->lang = $oLang->translateString(
'editor_language', $oLang->getTplLanguage() );
119 if ( $sEditObjectValue = $this->
_getEditValue( $oObject, $sField ) ) {
120 $this->_oEditor->value = $sEditObjectValue;
121 $this->_oEditor->encoding = $this->
getConfig()->isUtf() ?
'UTF-8':
'ISO-8859-15';
126 $sCSSPath =
$myConfig->getResourcePath(
"{$sStylesheet}",
false );
127 $sCSSUrl =
$myConfig->getResourceUrl(
"{$sStylesheet}",
false );
129 $aCSSPaths = array();
132 if (is_file($sCSSPath)) {
134 $aCSSPaths[] = $sCSSUrl;
136 if (is_readable($sCSSPath)) {
137 $aCSS = @file( $sCSSPath);
138 if ( isset( $aCSS) && $aCSS) {
141 foreach ( $aCSS as $key => $sLine ) {
142 $sLine = trim($sLine);
144 if ( $sLine[0] ==
'.' && !$oStr->strstr( $sLine,
'default' ) ) {
146 $sTag = $oStr->substr( $sLine, 1);
147 $iEnd = $oStr->strpos( $sTag,
' ' );
148 if ( !isset( $iEnd ) || !$iEnd ) {
149 $iEnd = $oStr->strpos( $sTag,
'\n' );
152 if ( $sTag = $oStr->substr( $sTag, 0, $iEnd ) ) {
153 $aClasses[
"span class='{$sTag}'"] = $sTag;
157 $this->_oEditor->stylesMenu = $aClasses;
162 foreach ( $aCSSPaths as $sCssPath ) {
163 $this->_oEditor->addStylesheet( $sCssPath );
168 $this->_oEditor->loadPlugin(
'templateFilter' );
169 $this->_oEditor->plugins[
'templateFilter']->protect(
'[{',
'}]' );
170 if (
$myConfig->getConfigParam(
'bl_perfParseLongDescinSmarty' ) ) {
171 $this->_oEditor->plugins[
'templateFilter']->assign(
'[{$oViewConf->getCurrentHomeDir()}]',
$myConfig->getShopURL() );
173 $this->_oEditor->plugins[
'templateFilter']->assign(
'[{ $oViewConf->getCurrentHomeDir()}]',
$myConfig->getSSLShopURL() );
191 $sEditObjectValue =
'';
192 if ( $oObject && $sField && isset( $oObject->$sField ) ) {
194 if ( $oObject->$sField instanceof
oxField ) {
195 $sEditObjectValue = $oObject->$sField->getRawValue();
197 $sEditObjectValue = $oObject->$sField->value;
201 $oObject->$sField =
new oxField( $sEditObjectValue,
oxField::T_RAW );
204 return $sEditObjectValue;
219 if ( !$this->
getConfig()->getConfigParam(
'bl_perfParseLongDescinSmarty' ) ) {
220 $aReplace = array(
'[{$shop->currenthomedir}]',
'[{$oViewConf->getCurrentHomeDir()}]' );
221 $sValue = str_replace( $aReplace, $this->
getConfig()->getCurrentShopURL(
false), $sValue );
238 $sEditObjectValue = $this->
_getEditValue( $oObject, $sField );
240 if ( strpos( $iWidth,
'%' ) ===
false ) {
243 if ( strpos( $iHeight,
'%' ) ===
false ) {
246 return "<textarea id='editor_{$sField}' style='width:{$iWidth}; height:{$iHeight};'>{$sEditObjectValue}</textarea>";
263 if ( $oEditor = $this->
_getTextEditor( $iWidth, $iHeight, $oObject, $sField, $sStylesheet ) ) {
265 $sEditorHtml = $oEditor->fetch( $iWidth, $iHeight );
267 $sEditorHtml = $this->
_getPlainEditor( $iWidth, $iHeight, $oObject, $sField );
316 protected function _createCategoryTree( $sTplVarName, $sEditCatId =
'', $blForceNonCache =
false, $iTreeShopId = null )
319 if ( !isset( $this->oCatTree ) || $blForceNonCache ) {
320 $this->oCatTree =
oxNew(
'oxCategoryList' );
321 $this->oCatTree->setShopID( $iTreeShopId );
324 $oBase = $this->oCatTree->getBaseObject();
325 $oBase->setLanguage( $this->_iEditLang );
327 $this->oCatTree->loadList();
331 $oCatTree = $this->oCatTree;
333 if ( $sEditCatId && isset( $oCatTree[$sEditCatId] ) ) {
334 unset( $oCatTree[$sEditCatId] );
338 $oRoot =
oxNew(
'oxcategory' );
339 $oRoot->oxcategories__oxtitle =
new oxField(
'--');
341 $oCatTree->assign( array_merge( array(
'' => $oRoot ), $oCatTree->getArray() ) );
344 $this->_aViewData[$sTplVarName] = $oCatTree;
361 protected function _getCategoryTree( $sTplVarName, $sSelectedCatId, $sEditCatId =
'', $blForceNonCache =
false, $iTreeShopId = null )
363 $oCatTree = $this->
_createCategoryTree($sTplVarName, $sEditCatId, $blForceNonCache, $iTreeShopId);
366 if ( $sSelectedCatId ) {
368 foreach ($oCatTree as $oCategory) {
369 if ($oCategory->getId() == $sSelectedCatId ) {
370 $oCategory->selected = 1;
377 if ( $oCat = $oCatTree->current() ) {
379 $sSelectedCatId = $oCat->getId();
384 $this->_aViewData[$sTplVarName] = $oCatTree;
386 return $sSelectedCatId;
399 if ( $sFolderClass ==
'oxcontent' && $sFolder ==
'CMSFOLDER_NONE' ) {
403 $oObject =
oxNew( $sFolderClass );
404 if ( $oObject->load( $this->getEditObjectId() ) ) {
405 $oObject->{$oObject->getCoreTableName() .
'__oxfolder'} =
new oxField($sFolder);
417 protected function _setupNavigation( $sNode )
422 $myAdminNavig = $this->getNavigation();
425 $this->_aViewData[
'default_edit'] = $myAdminNavig->getActiveTab( $sNode, $this->_iDefEdit );
428 $this->_aViewData[
'bottom_buttons'] = $myAdminNavig->getBtn( $sNode );
439 protected function _resetCounts( $aIds )
442 foreach ( $aIds as $sType => $aResetInfo ) {
443 foreach ( $aResetInfo as $sResetId => $iPos ) {
446 $this->resetCounter(
"vendorArticle", $sResetId );
449 $this->resetCounter(
"manufacturerArticle", $sResetId );