Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r11525 -r11538 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11525) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11538) @@ -484,10 +484,9 @@ */ function SaveWarning($params) { - if ($this->Prefix != 'c') { + if ($this->Prefix == 'st') { // don't use this method for other prefixes then Category, that use this tag processor - parent::SaveWarning($params); - return ; + return parent::SaveWarning($params); } $main_prefix = getArrayValue($params, 'main_prefix'); @@ -552,16 +551,31 @@ } /** + * Returns home category id + * + * @param Array $params + * @return int + */ + function HomeCategory($params) + { + static $root_category = null; + + if (!isset($root_category)) { + $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat'); + } + + return $root_category; + } + + /** * Used for disabling "Home" and "Up" buttons in category list * * @param Array $params * @return bool */ function ModuleRootCategory($params) { - $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat'); - - return $this->Application->GetVar('m_cat_id') == $root_category; + return $this->Application->GetVar('m_cat_id') == $this->HomeCategory($params); } function CatalogItemCount($params) @@ -1896,6 +1910,43 @@ return $text; } -} + /** + * Hide all editing tabs except permission tab, when editing "Home" (ID = 0) category + * + * @param Array $params + */ + function ModifyUnitConfig($params) + { + $root_category = $this->Application->RecallVar('IsRootCategory_' . $this->Application->GetVar('m_wid')); + if (!$root_category) { + return ; + } -?> \ No newline at end of file + $edit_tab_presets = $this->Application->getUnitOption($this->Prefix, 'EditTabPresets'); + $edit_tab_presets['Default'] = Array ( + 'permissions' => $edit_tab_presets['Default']['permissions'], + ); + $this->Application->setUnitOption($this->Prefix, 'EditTabPresets', $edit_tab_presets); + } + + /** + * Prints catalog export templates + * + * @param Array $params + * @return string + */ + function PrintCatalogExportTemplates($params) + { + $prefixes = explode(',', $params['prefixes']); + + $ret = Array (); + foreach ($prefixes as $prefix) { + $ret[$prefix] = $this->Application->getUnitOption($prefix, 'ModuleFolder') . '/export'; + } + + $json_helper =& $this->Application->recallObject('JSONHelper'); + /* @var $json_helper JSONHelper */ + + return $json_helper->encode($ret); + } +} \ No newline at end of file