Index: admin/system_presets/simple/categories_c.php =================================================================== --- admin/system_presets/simple/categories_c.php (revision 13936) +++ admin/system_presets/simple/categories_c.php (working copy) @@ -45,7 +45,7 @@ 'CachedNavbar',*/ 'CreatedById', /*'ResourceId', 'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath', 'MetaDescription', 'HotItem',*/ 'NewItem', /*'PopItem', 'Modified', 'ModifiedById', 'CachedTemplate',*/ 'Template', /*'UseExternalUrl', 'ExternalUrl',*/ 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle', - /*'MetaTitle', 'IndexTools', 'IsMenu', 'IsSystem',*/ 'FormId', 'FormSubmittedTemplate', + /*'MetaTitle', 'IndexTools', 'IsMenu',*/'Protected', 'Type', 'FormId', 'FormSubmittedTemplate', /*'FriendlyURL', 'ThemeId', 'EnablePageCache', 'OverridePageCacheKey', 'PageCacheKey', 'PageExpiration'*/ ); @@ -76,9 +76,9 @@ // hide columns in grids $hide_columns = Array ( - 'Default' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'IsSystem',*/ 'Priority'), - 'DefaultShowAll' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'IsSystem', 'Priority', 'CachedNavbar'*/), - 'Radio' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'IsSystem',*/ 'Priority'), - 'RadioShowALl' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'IsSystem', 'Priority', 'CachedNavbar'*/), - 'Structure' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'Path', 'IsSystem',*/ 'Priority'), + 'Default' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu',*/ 'Protected', /*'Type',*/ 'Priority'), + 'DefaultShowAll' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu',*/ 'Protected',/*'Type', 'Priority', 'CachedNavbar'*/), + 'Radio' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu',*/ 'Protected', /*'Type',*/ 'Priority'), + 'RadioShowALl' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu',*/ 'Protected'/*, 'Type', 'Priority', 'CachedNavbar'*/), + 'Structure' => Array (/*'CategoryId', 'Name', 'Modified',*/ 'Template', /*'IsMenu', 'Path',*/ 'Protected',/*'Type',*/ 'Priority'), ); \ No newline at end of file Index: core/admin_templates/catalog_tab.tpl =================================================================== --- core/admin_templates/catalog_tab.tpl (revision 13936) +++ core/admin_templates/catalog_tab.tpl (working copy) @@ -64,7 +64,7 @@ <inp2:m_Phrase name='la_alt_Browse' html_escape='1'/> - +  * Index: core/admin_templates/categories/categories_edit.tpl =================================================================== --- core/admin_templates/categories/categories_edit.tpl (revision 13949) +++ core/admin_templates/categories/categories_edit.tpl (working copy) @@ -68,33 +68,91 @@ - - + + + + + + + + - + - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + @@ -126,94 +184,99 @@ Index: core/install/english.lang =================================================================== --- core/install/english.lang (revision 13936) +++ core/install/english.lang (working copy) @@ -155,6 +155,7 @@ UHJpbWFyeSBWYWx1ZQ== T3JkZXI= RmllbGQgUHJvbXB0 + UHJvdGVjdGVk UXVldWVk UmF0aW5n UmVjaXBpZW50IFR5cGU= @@ -569,6 +570,7 @@ UHJpbWFyeSBMYW5ndWFnZSBQaHJhc2U= T3JkZXI= Q29udmVydCB1bm1hdGNoZWQgZS1tYWlscyBpbnRvIG5ldyBzdWJtaXNzaW9ucw== + UHJvdGVjdGVk UXVhbnRpdHk= UmF0aW5n UmVjaXBpZW50J3MgQWRkcmVzcw== @@ -804,6 +806,7 @@ U3VjY2Vzcw== U3lzdGVt VGFi + VGVtcGxhdGU= VGl0bGU= VXNlcg== RW1haWwgQWN0aXZhdGlvbg== @@ -811,6 +814,7 @@ VXNlcm5hbWU= Tm90IEFsbG93ZWQ= VXBvbiBBcHByb3ZhbA== + VmlydHVhbA== d2VlayhzKQ== eWVhcihzKQ== Wmlw Index: core/install/install_schema.sql =================================================================== --- core/install/install_schema.sql (revision 13936) +++ core/install/install_schema.sql (working copy) @@ -398,7 +398,7 @@ CREATE TABLE Category ( CategoryId int(11) NOT NULL AUTO_INCREMENT, - `Type` int(11) NOT NULL DEFAULT '0', + `Type` int(11) NOT NULL DEFAULT '1', SymLinkCategoryId int(10) unsigned DEFAULT NULL, ParentId int(11) NOT NULL DEFAULT '0', `Name` varchar(255) NOT NULL DEFAULT '', @@ -458,7 +458,7 @@ MetaTitle text, IndexTools text, IsMenu tinyint(4) NOT NULL DEFAULT '1', - IsSystem tinyint(4) NOT NULL DEFAULT '0', + Protected tinyint(4) NOT NULL DEFAULT '0', FormId int(11) DEFAULT NULL, FormSubmittedTemplate varchar(255) DEFAULT NULL, FriendlyURL varchar(255) NOT NULL DEFAULT '', @@ -493,7 +493,8 @@ KEY ThemeId (ThemeId), KEY EnablePageCache (EnablePageCache), KEY OverridePageCacheKey (OverridePageCacheKey), - KEY PageExpiration (PageExpiration) + KEY PageExpiration (PageExpiration), + KEY Protected (Protected) ); CREATE TABLE CategoryCustomData ( Index: core/install/upgrades.sql =================================================================== --- core/install/upgrades.sql (revision 13936) +++ core/install/upgrades.sql (working copy) @@ -1944,3 +1944,11 @@ UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'Comments' WHERE PhraseKey = 'LA_FLD_COMMENTS'; + +ALTER TABLE Category + CHANGE `Type` `Type` INT(11) NOT NULL DEFAULT '1', + CHANGE `IsSystem` `Protected` TINYINT( 4 ) NOT NULL DEFAULT '0', + ADD INDEX ( `Protected` ); + +UPDATE Category SET `Type` = IF(`Protected` = 1, 2, 1); +UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0; \ No newline at end of file Index: core/kernel/constants.php =================================================================== --- core/kernel/constants.php (revision 13936) +++ core/kernel/constants.php (working copy) @@ -161,7 +161,7 @@ // site domains define('SITE_DOMAIN_REDIRECT_CURRENT', 1); define('SITE_DOMAIN_REDIRECT_EXTERNAL', 2); - + define ('KG_TO_POUND', 2.20462262); define ('POUND_TO_KG', 0.45359237); @@ -173,4 +173,6 @@ define('RECIPIENT_TYPE_TO', 1); define('RECIPIENT_TYPE_CC', 2); define('RECIPIENT_TYPE_BCC', 3); - \ No newline at end of file + + define('PAGE_TYPE_VIRTUAL', 1); + define('PAGE_TYPE_TEMPLATE', 2); \ No newline at end of file Index: core/units/categories/categories_config.php =================================================================== --- core/units/categories/categories_config.php (revision 13941) +++ core/units/categories/categories_config.php (working copy) @@ -290,7 +290,6 @@ 'LocalImage' => 'img.LocalImage', 'LocalPath' => 'img.LocalPath', 'FullUrl' => 'img.Url', - 'CreatedBySystem' => 'IF(ThemeId != 0, 1, 0)', ), '-virtual' => Array (), ), @@ -299,7 +298,11 @@ 'Fields' => Array ( 'CategoryId' => Array ('type' => 'int', 'not_null' => 1,'default' => 0), - 'Type' => Array ('type' => 'int', 'not_null' => 1,'default' => 0), + 'Type' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Virtual', 2 => 'la_opt_Template'), 'use_phrases' => 1, + 'not_null' => 1,'default' => 1 + ), 'SymLinkCategoryId' => Array ('type' => 'int', 'default' => NULL), 'ParentId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'not_null' => 1,'default' => 0, 'required' => 1), 'Name' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'default' => ''), @@ -374,7 +377,7 @@ 'MetaTitle' => Array ('type' => 'string', 'default' => null), 'IndexTools' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), 'IsMenu' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Show', 0 => 'la_Hide'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'IsSystem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_System', 0 => 'la_text_User'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), + 'Protected' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'FormId' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ('' => ''), @@ -414,12 +417,11 @@ 'LocalImage' => Array('type' => 'string', 'default' => ''), 'LocalPath' => Array('type' => 'string', 'default' => ''), 'FullUrl' => Array('type' => 'string', 'default' => ''), - 'CreatedBySystem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_System', 0 => 'la_text_User'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), ), 'Grids' => Array( 'Default' => Array ( - 'Icons' => Array( // 'StatusField' => Array ('IsSystem', 'Status', 'IsMenu'), // 'Status' + 'Icons' => Array( // 'StatusField' => Array ('Type', 'Status', 'IsMenu'), // 'Status' 'default' => 'icon_section.png', '1_0_0' => 'icon16_section_system.png', // system '1_0_1' => 'icon16_section_system.png', // system @@ -438,15 +440,16 @@ 'Modified' => Array( 'title'=>'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 170), 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter', 'width' => 220), 'IsMenu' => Array( 'title'=>'la_col_InMenu', 'filter_block' => 'grid_options_filter', 'width' => 70), - 'CreatedBySystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100), 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), 'Radio' => Array ( 'Selector' => 'radio', - 'Icons' => Array( // 'StatusField' => Array ('IsSystem', 'Status', 'IsMenu'), // 'Status' + 'Icons' => Array( // 'StatusField' => Array ('Type', 'Status', 'IsMenu'), // 'Status' 'default' => 'icon_section.png', '1_0_0' => 'icon16_section_system.png', // system '1_0_1' => 'icon16_section_system.png', // system @@ -465,14 +468,15 @@ 'IsMenu' => Array( 'title'=>'la_col_InMenu', 'filter_block' => 'grid_options_filter', 'width' => 70), 'Modified' => Array( 'title'=>'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 170), 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter', 'width' => 220), - 'CreatedBySystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100), 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), 'Structure' => Array ( - 'Icons' => Array( // 'StatusField' => Array ('IsSystem', 'Status', 'IsMenu'), // 'Status' + 'Icons' => Array( // 'StatusField' => Array ('Type', 'Status', 'IsMenu'), // 'Status' 'default' => 'icon_section.png', '1_0_0' => 'icon16_section_system.png', // system '1_0_1' => 'icon16_section_system.png', // system @@ -492,8 +496,9 @@ 'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter'), 'Modified' => Array( 'title'=>'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 170), 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter', 'width' => 220), - 'CreatedBySystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100), 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), Index: core/units/categories/categories_event_handler.php =================================================================== --- core/units/categories/categories_event_handler.php (revision 13936) +++ core/units/categories/categories_event_handler.php (working copy) @@ -591,7 +591,7 @@ ( (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + (`Type` = ' . PAGE_TYPE_TEMPLATE . ' AND CachedTemplate = ' . $this->Conn->qstr($template) . ') ) AND (ThemeId = ' . $this->_getCurrentThemeId() . ' OR ThemeId = 0)'; $page_id = $this->Conn->GetOne($sql); @@ -1143,7 +1143,7 @@ $sql = 'SELECT ' . $id_field . ' FROM ' . $table_name . ' - WHERE ' . $id_field . ' IN (' . implode(',', $clipboard_data['copy']) . ') AND (IsSystem = 0) AND (ThemeId = 0)'; + WHERE ' . $id_field . ' IN (' . implode(',', $clipboard_data['copy']) . ') AND (`Type` = ' . PAGE_TYPE_VIRTUAL . ') AND (ThemeId = 0)'; $allowed_ids = $this->Conn->GetCol($sql); if (!$allowed_ids) { @@ -1405,29 +1405,21 @@ $ids = $this->StoreSelectedIDs($event); if ($ids) { + $propagate_category_status = $this->Application->GetVar('propagate_category_status'); $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') ); foreach ($ids as $id) { $object->Load($id); + $object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0); - switch ($event->Name) { - case 'OnMassApprove': - $object->SetDBField($status_field, 1); - break; + if ($object->Update()) { + if ($propagate_category_status) { + $sql = 'UPDATE '.$object->TableName.' + SET '.$status_field.' = '.$object->GetDBField($status_field).' + WHERE TreeLeft BETWEEN '.$object->GetDBField('TreeLeft').' AND '.$object->GetDBField('TreeRight'); + $this->Conn->Query($sql); + } - case 'OnMassDecline': - $object->SetDBField($status_field, 0); - break; - } - - if ($this->Application->GetVar('propagate_category_status')) { - $sql = 'UPDATE '.$object->TableName.' - SET '.$status_field.' = '.$object->GetDBField($status_field).' - WHERE TreeLeft BETWEEN '.$object->GetDBField('TreeLeft').' AND '.$object->GetDBField('TreeRight'); - $this->Conn->Query($sql); - } - - if ($object->Update()) { $event->status = erSUCCESS; $email_event = $event->Name == 'OnMassApprove' ? 'CATEGORY.APPROVE' : 'CATEGORY.DENY'; @@ -1568,6 +1560,18 @@ $now = adodb_mktime(); + if ( !$this->Application->isDebugMode() ) { + $object->SetDBField('Type', $object->GetOriginalField('Type')); + $object->SetDBField('Protected', $object->GetOriginalField('Protected')); + + if ( $object->GetDBField('Protected') ) { + // some fields are read-only for protected pages, when debug mode is off + $object->SetDBField('AutomaticFilename', $object->GetOriginalField('AutomaticFilename')); + $object->SetDBField('Filename', $object->GetOriginalField('Filename')); + $object->SetDBField('Status', $object->GetOriginalField('Status')); + } + } + if ($object->GetChangedFields()) { $object->SetDBField('Modified_date', $now); $object->SetDBField('Modified_time', $now); @@ -1576,7 +1580,7 @@ $object->setRequired('PageCacheKey', $object->GetDBField('OverridePageCacheKey')); $object->SetDBField('Template', $this->_stripTemplateExtension( $object->GetDBField('Template') )); - if ($object->GetDBField('IsSystem') == 1) { + if ($object->GetDBField('Type') == PAGE_TYPE_TEMPLATE) { if (!$this->_templateFound($object->GetDBField('Template'), $object->GetDBField('ThemeId'))) { $object->SetError('Template', 'template_file_missing', 'la_error_TemplateFileMissing'); } @@ -1636,7 +1640,8 @@ function OnBeforeItemDelete(&$event) { $object =& $event->getObject(); - if ($object->GetDBField('IsSystem') && !$this->Application->isDebugMode()) { + + if ( $object->GetDBField('Protected') && !$this->Application->isDebugMode() ) { $event->status = erFAIL; } } @@ -1652,13 +1657,13 @@ $template = $this->_stripTemplateExtension($template); if ($system_mode == SMS_MODE_AUTO) { - $system = $this->_templateFound($template, $theme_id) ? 1 : 0; + $page_type = $this->_templateFound($template, $theme_id) ? PAGE_TYPE_TEMPLATE : PAGE_TYPE_VIRTUAL; } else { - $system = $system_mode == SMS_MODE_FORCE ? 1 : 0; + $page_type = $system_mode == SMS_MODE_FORCE ? PAGE_TYPE_TEMPLATE : PAGE_TYPE_VIRTUAL; } - if ($system && $template_info === false) { + if (($page_type == PAGE_TYPE_TEMPLATE) && ($template_info === false)) { // do not autocreate system pages, when browsing through site return false; } @@ -1674,7 +1679,7 @@ $this->Application->SetVar('m_cat_id', $page_category); } - if (!$system && strpos($template, '/') !== false) { + if (($page_type == PAGE_TYPE_VIRTUAL) && (strpos($template, '/') !== false)) { // virtual page, but have "/" in template path -> create it's path $category_path = explode('/', $template); $template = array_pop($category_path); @@ -1682,10 +1687,10 @@ $page_category = $this->_getParentCategoryFromPath($category_path, $root_category, $theme_id); } - $page_name = $system ? '_Auto: ' . $template : $template; + $page_name = ($page_type == PAGE_TYPE_TEMPLATE) ? '_Auto: ' . $template : $template; $page_description = ''; - if ($system) { + if ($page_type == PAGE_TYPE_TEMPLATE) { $design_template = strtolower($template); // leading "/" not added ! if ($template_info) { if (array_key_exists('name', $template_info) && $template_info['name']) { @@ -1708,10 +1713,11 @@ $object->Clear(); $object->SetDBField('ParentId', $page_category); - $object->SetDBField('IsSystem', $system); + $object->SetDBField('Type', $page_type); + $object->SetDBField('Protected', 1); // $page_type == PAGE_TYPE_TEMPLATE $object->SetDBField('IsMenu', 0); - $object->SetDBField('ThemeId', $theme_id); // $system ? $theme_id : 0 + $object->SetDBField('ThemeId', $theme_id); // put all templates to then end of list (in their category) $min_priority = $this->_getNextPriority($page_category, $object->TableName); Index: core/units/categories/categories_item.php =================================================================== --- core/units/categories/categories_item.php (revision 13936) +++ core/units/categories/categories_item.php (working copy) @@ -97,7 +97,7 @@ // filename will be generated from scratch, don't check anything here return ; } - elseif ($this->GetDBField('IsSystem')) { + elseif ($this->GetDBField('Type') == PAGE_TYPE_TEMPLATE) { // system page with AutomaticFilename checkbox unchecked -> compatibility with Proj-CMS <= 4.3.9 (when "/" were allowed in Filename) return ; } Index: core/units/categories/categories_tag_processor.php =================================================================== --- core/units/categories/categories_tag_processor.php (revision 13936) +++ core/units/categories/categories_tag_processor.php (working copy) @@ -87,7 +87,7 @@ $object =& $this->getObject($params); /* @var $object kDBList */ - if ($object->GetDBField('CreatedBySystem')) { + if ($object->GetDBField('ThemeId') > 0) { if (!$object->GetDBField('IsMenu')) { return $icon_prefix . 'section_menuhidden_system.png'; } @@ -511,9 +511,9 @@ else { // all done, update left tree and redirect $updater->SaveData(); - $this->Application->RemoveVar('PermCache_UpdateRequired'); - $this->Application->StoreVar('RefreshStructureTree', 1); - $this->Application->Redirect($params['destination_template']); + $this->Application->RemoveVar('PermCache_UpdateRequired'); + $this->Application->StoreVar('RefreshStructureTree', 1); + $this->Application->Redirect($params['destination_template']); } $ret = $updater->getDonePercent(); @@ -1962,4 +1962,16 @@ return $json_helper->encode($categories); } + + function PageEditable($params) + { + if ($this->Application->isDebugMode()) { + return true; + } + + $object =& $this->getObject($params); + /* @var $object kDBItem */ + + return !$object->GetDBField('Protected'); + } } \ No newline at end of file Index: core/units/helpers/category_helper.php =================================================================== --- core/units/helpers/category_helper.php (revision 13936) +++ core/units/helpers/category_helper.php (working copy) @@ -472,7 +472,7 @@ } $sql = 'SELECT - IF(c.IsSystem, CONCAT(c.Template, ":", c.ThemeId), CONCAT("id:", c.CategoryId)) AS SrcTemplate, + IF(c.`Type` = ' . PAGE_TYPE_TEMPLATE . ', CONCAT(c.Template, ":", c.ThemeId), CONCAT("id:", c.CategoryId)) AS SrcTemplate, LOWER( IF( c.SymLinkCategoryId IS NOT NULL, Index: core/units/helpers/menu_helper.php =================================================================== --- core/units/helpers/menu_helper.php (revision 13936) +++ core/units/helpers/menu_helper.php (working copy) @@ -236,7 +236,7 @@ 'cat_id' => $page['CategoryId'], 'item_type' => $page['ItemType'], 'page_id' => $page['ItemId'], - 'use_section' => (int)$page['IsSystem'] && ($page['ItemPath'] != 'index'), + 'use_section' => ($page['Type'] == PAGE_TYPE_TEMPLATE) && ($page['ItemPath'] != 'index'), 'has_sub_menu' => isset($page['sub_items']) && count($page['sub_items']) > 0, 'external_url' => $page['UseExternalUrl'] ? $page['ExternalUrl'] : false, // for backward compatibility 'menu_icon' => $page['UseMenuIconUrl'] ? $page['MenuIconUrl'] : false, @@ -341,11 +341,11 @@ c.Priority AS ItemPriority, ' . $lang_part . ' - IF(c.IsSystem, c.Template, CONCAT("id:", c.CategoryId)) AS ItemPath, + IF(c.`Type` = ' . PAGE_TYPE_TEMPLATE . ', c.Template, CONCAT("id:", c.CategoryId)) AS ItemPath, c.ParentPath AS ParentPath, c.ParentId As ParentId, \'cat\' AS ItemType, - c.IsMenu, c.IsSystem, c.ThemeId, c.UseExternalUrl, c.ExternalUrl, c.UseMenuIconUrl, c.MenuIconUrl + c.IsMenu, c.Type, c.ThemeId, c.UseExternalUrl, c.ExternalUrl, c.UseMenuIconUrl, c.MenuIconUrl FROM ' . TABLE_PREFIX . 'Category AS c WHERE c.Status = ' . STATUS_ACTIVE; $items = $this->Conn->Query($sql, 'ItemId'); Index: core/units/helpers/themes_helper.php =================================================================== --- core/units/helpers/themes_helper.php (revision 13936) +++ core/units/helpers/themes_helper.php (working copy) @@ -539,7 +539,7 @@ WHERE ( (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + (`Type` = ' . PAGE_TYPE_TEMPLATE . ' AND CachedTemplate = ' . $this->Conn->qstr($template) . ') ) AND (ThemeId = ' . $theme_id . ($theme_id > 0 ? ' OR ThemeId = 0' : '') . ')'; Index: core/units/structure/structure_config.php =================================================================== --- core/units/structure/structure_config.php (revision 13936) +++ core/units/structure/structure_config.php (working copy) @@ -124,7 +124,11 @@ 'Fields' => Array ( 'CategoryId' => Array('type' => 'int', 'not_null' => 1,'default' => 0), - 'Type' => Array('type' => 'int','not_null' => 1,'default' => 0), + 'Type' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Virtual', 2 => 'la_opt_Template'), 'use_phrases' => 1, + 'not_null' => 1,'default' => 1 + ), 'SymLinkCategoryId' => Array ('type' => 'int', 'default' => NULL), 'ParentId' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'not_null' => 1,'default' => 0, 'required'=>1), 'Name' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'default' => ''), @@ -182,7 +186,7 @@ 'MetaTitle' => Array('type' => 'string', 'default' => null), 'IndexTools' => Array('type' => 'string','default' => null), 'IsMenu' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Show', 0 => 'la_Hide'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_System', 0 => 'la_Regular'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), + 'Protected' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'FormId' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => array('' => ''), 'options_sql' => 'SELECT Title, FormId FROM '.TABLE_PREFIX.'Forms ORDER BY Title', @@ -221,7 +225,7 @@ 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), 'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'use_phrases'=>1 ), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), @@ -235,7 +239,7 @@ 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), 'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'use_phrases'=>1 ), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), @@ -248,7 +252,7 @@ 'Modified' => Array( 'title'=>'la_col_Modified', 'filter_block' => 'grid_date_range_filter' ), 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter', 'hidden' => true ), 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', 'use_phrases'=>1 ), + 'Protected' => Array( 'title'=>'la_col_Protected', 'filter_block' => 'grid_options_filter', 'width' => 100), ), ), ),