33 $sDir =
$myConfig->getConfigParam(
'sShopDir') .
'/documentation/admin';
35 $sAbbr = $oLang->getLanguageAbbr($oLang->getTplLanguage());
40 $sDir =
$myConfig->getConfigParam(
'sShopURL') .
'documentation/admin';
46 $sDir =
"http://docu.oxid-esales.com/PE/{$oShop->oxshops__oxversion->value}/" . $iLang .
'/admin';
49 $this->_aViewData[
'sHelpURL'] = $sDir;
67 protected function _getTextEditor($iWidth, $iHeight, $oObject, $sField, $sStylesheet = null)
69 if ($this->_oEditor === null) {
73 $sEditorPath =
'wysiwigpro';
74 $sEditorFile = getShopBasePath() .
"core/" . $sEditorPath .
'/wysiwygPro.class.php';
78 $this->_oEditor =
false;
80 if ($sEditorFile && file_exists($sEditorFile)) {
81 include_once $sEditorFile;
84 $this->_oEditor =
new wysiwygPro();
92 $this->_oEditor->editorURL = $sEditorUrl;
93 $this->_oEditor->urlFormat =
'preserve';
96 $sPictureDir =
$myConfig->getPictureDir(
false) .
'wysiwigpro/';
97 $sPictureUrl =
$myConfig->getPictureUrl(null,
false) .
'wysiwigpro/';
98 $this->_oEditor->documentDir = $this->_oEditor->imageDir = $sPictureDir;
99 $this->_oEditor->documentURL = $this->_oEditor->imageURL = $sPictureUrl;
102 $this->_oEditor->upload =
true;
105 $this->_oEditor->emptyValue =
"<p> </p>";
108 $this->_oEditor->deleteFiles =
true;
109 $this->_oEditor->deleteFolders =
true;
112 $this->_oEditor->allowedImageExtensions =
'.jpg, .jpeg, .gif, .png';
115 $this->_oEditor->allowedDocExtensions =
'.html, .htm, .pdf, .doc, .rtf, .txt, .xl, .xls, .ppt, .pps, ' .
116 '.zip, .tar, .swf, .wmv, .rm, .mov, .jpg, .jpeg, .gif, .png';
119 $this->_oEditor->name = $sField;
123 $this->_oEditor->lang = $oLang->translateString(
'editor_language', $oLang->getTplLanguage());
126 if ($sEditObjectValue = $this->
_getEditValue($oObject, $sField)) {
127 $this->_oEditor->value = $sEditObjectValue;
128 $this->_oEditor->encoding = $this->
getConfig()->isUtf() ?
'UTF-8' :
'ISO-8859-15';
133 $sCSSPath =
$myConfig->getResourcePath(
"{$sStylesheet}",
false);
134 $sCSSUrl =
$myConfig->getResourceUrl(
"{$sStylesheet}",
false);
136 $aCSSPaths = array();
139 if (is_file($sCSSPath)) {
141 $aCSSPaths[] = $sCSSUrl;
143 if (is_readable($sCSSPath)) {
144 $aCSS = @file($sCSSPath);
145 if (isset($aCSS) && $aCSS) {
148 foreach ($aCSS as $key => $sLine) {
149 $sLine = trim($sLine);
151 if ($sLine[0] ==
'.' && !$oStr->strstr($sLine,
'default')) {
153 $sTag = $oStr->substr($sLine, 1);
154 $iEnd = $oStr->strpos($sTag,
' ');
155 if (!isset($iEnd) || !$iEnd) {
156 $iEnd = $oStr->strpos($sTag,
'\n');
159 if ($sTag = $oStr->substr($sTag, 0, $iEnd)) {
160 $aClasses[
"span class='{$sTag}'"] = $sTag;
164 $this->_oEditor->stylesMenu = $aClasses;
169 foreach ($aCSSPaths as $sCssPath) {
170 $this->_oEditor->addStylesheet($sCssPath);
175 $this->_oEditor->loadPlugin(
'templateFilter');
176 $this->_oEditor->plugins[
'templateFilter']->protect(
'[{',
'}]');
177 if (
$myConfig->getConfigParam(
'bl_perfParseLongDescinSmarty')) {
178 $sCurrentHomeDir =
'[{$oViewConf->getCurrentHomeDir()}]';
179 $this->_oEditor->plugins[
'templateFilter']->assign($sCurrentHomeDir,
$myConfig->getShopURL());
182 $this->_oEditor->plugins[
'templateFilter']->assign($sCurrentHomeDir,
$myConfig->getSSLShopURL());
200 $sEditObjectValue =
'';
201 if ($oObject && $sField && isset($oObject->$sField)) {
203 if ($oObject->$sField instanceof
oxField) {
204 $sEditObjectValue = $oObject->$sField->getRawValue();
206 $sEditObjectValue = $oObject->$sField->value;
210 $oObject->$sField =
new oxField($sEditObjectValue,
oxField::T_RAW);
213 return $sEditObjectValue;
228 if (!$this->
getConfig()->getConfigParam(
'bl_perfParseLongDescinSmarty')) {
229 $aReplace = array(
'[{$shop->currenthomedir}]',
'[{$oViewConf->getCurrentHomeDir()}]');
230 $sValue = str_replace($aReplace, $this->
getConfig()->getCurrentShopURL(
false), $sValue);
250 if (strpos($iWidth,
'%') ===
false) {
253 if (strpos($iHeight,
'%') ===
false) {
257 return "<textarea id='editor_{$sField}' style='width:{$iWidth}; height:{$iHeight};'>{$sEditObjectValue}</textarea>";
275 if ($oEditor = $this->
_getTextEditor($iWidth, $iHeight, $oObject, $sField, $sStylesheet)) {
277 $sEditorHtml = $oEditor->fetch($iWidth, $iHeight);
280 $sEditorHtml = $this->
_getPlainEditor($iWidth, $iHeight, $oObject, $sField);
323 protected function _createCategoryTree($sTplVarName, $sEditCatId =
'', $blForceNonCache =
false, $iTreeShopId = null)
326 if (!isset($this->oCatTree) || $blForceNonCache) {
327 $this->oCatTree =
oxNew(
'oxCategoryList');
328 $this->oCatTree->setShopID($iTreeShopId);
331 $oBase = $this->oCatTree->getBaseObject();
332 $oBase->setLanguage($this->_iEditLang);
334 $this->oCatTree->loadList();
338 $oCatTree = $this->oCatTree;
340 if ($sEditCatId && isset($oCatTree[$sEditCatId])) {
341 unset($oCatTree[$sEditCatId]);
345 $oRoot =
oxNew(
'oxcategory');
346 $oRoot->oxcategories__oxtitle =
new oxField(
'--');
348 $oCatTree->assign(array_merge(array(
'' => $oRoot), $oCatTree->getArray()));
351 $this->_aViewData[$sTplVarName] = $oCatTree;
368 protected function _getCategoryTree($sTplVarName, $sSelectedCatId, $sEditCatId =
'', $blForceNonCache =
false, $iTreeShopId = null)
370 $oCatTree = $this->
_createCategoryTree($sTplVarName, $sEditCatId, $blForceNonCache, $iTreeShopId);
373 if ($sSelectedCatId) {
375 foreach ($oCatTree as $oCategory) {
376 if ($oCategory->getId() == $sSelectedCatId) {
377 $oCategory->selected = 1;
384 if ($oCat = $oCatTree->current()) {
386 $sSelectedCatId = $oCat->getId();
391 $this->_aViewData[$sTplVarName] = $oCatTree;
393 return $sSelectedCatId;
404 if ($sFolderClass ==
'oxcontent' && $sFolder ==
'CMSFOLDER_NONE') {
408 $oObject =
oxNew($sFolderClass);
409 if ($oObject->load($this->getEditObjectId())) {
410 $oObject->{$oObject->getCoreTableName() .
'__oxfolder'} =
new oxField($sFolder);
420 protected function _setupNavigation($sNode)
425 $myAdminNavig = $this->getNavigation();
428 $this->_aViewData[
'default_edit'] = $myAdminNavig->getActiveTab($sNode, $this->_iDefEdit);
431 $this->_aViewData[
'bottom_buttons'] = $myAdminNavig->getBtn($sNode);
440 protected function _resetCounts($aIds)
443 foreach ($aIds as $sType => $aResetInfo) {
444 foreach ($aResetInfo as $sResetId => $iPos) {
447 $this->resetCounter(
"vendorArticle", $sResetId);
450 $this->resetCounter(
"manufacturerArticle", $sResetId);