Index: branches/RC/core/units/categories/categories_tag_processor.php
===================================================================
diff -u -r11501 -r11504
--- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11501)
+++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11504)
@@ -1016,13 +1016,13 @@
// different path in structure AND design template differes from requested template
$structure_path_match = strtolower( $page->GetDBField('NamedParentPath') ) == strtolower('Content/' . $template);
- $design_match = $page->GetDBField('Template') == $template;
+ $design_match = $page->GetDBField('CachedTemplate') == $template;
if (!$structure_path_match && !$design_match) {
// Same sql like in "c:getPassedID". Load, when current page object doesn't match requested page object
$sql = 'SELECT ' . $page->IDField . '
FROM ' . $page->TableName . '
- WHERE (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR (IsSystem = 1 AND Template = ' . $this->Conn->qstr($template) . ')';
+ WHERE (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')';
$page_id = $this->Conn->GetOne($sql);
$page->Load($page_id);
@@ -1612,8 +1612,8 @@
$lang_part = '';
for ($i = 1; $i <= $languages_count; $i++) {
- $lang_part .= 'c.l' . $i . '_Name AS l' . $i . '_ItemName,' . "\n";
- // $lang_part .= 'p.l' . $i . '_MenuTitle AS l' . $i . '_ItemName,' . "\n";
+// $lang_part .= 'c.l' . $i . '_Name AS l' . $i . '_ItemName,' . "\n";
+ $lang_part .= 'c.l' . $i . '_MenuTitle AS l' . $i . '_ItemName,' . "\n";
}
// Sub-categories from current category
@@ -1750,7 +1750,7 @@
*
* @param Array $params
* @return string
- * @todo Needs to be replaced with "m:GetConfig" tag
+ * @todo Needs to be replaced with "m:GetConfig" tag; Not used now (were used on structure_edit.tpl).
*/
function AllowManualFilenames($params)
{
Index: branches/RC/core/units/general/helpers/mod_rewrite_helper.php
===================================================================
diff -u -r11501 -r11504
--- branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 11501)
+++ branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 11504)
@@ -171,7 +171,7 @@
}
}
- $sql = 'SELECT CachedCategoryTemplate
+ $sql = 'SELECT CachedTemplate
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$vars['m_cat_id'];
$vars['t'] = $this->Conn->GetOne($sql);
Index: branches/RC/core/install/upgrades.sql
===================================================================
diff -u -r11495 -r11504
--- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11495)
+++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11504)
@@ -1013,6 +1013,8 @@
ALTER TABLE Language ADD UserDocsUrl VARCHAR(255) NOT NULL;
+UPDATE Category SET Template = CategoryTemplate WHERE CategoryTemplate <> '';
+
ALTER TABLE Category
ADD ThemeId INT UNSIGNED NOT NULL,
ADD INDEX (ThemeId),
@@ -1021,8 +1023,16 @@
ADD COLUMN UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0' AFTER ExternalUrl,
ADD COLUMN MenuIconUrl varchar(255) NOT NULL default '' AFTER UseMenuIconUrl,
CHANGE MetaKeywords MetaKeywords TEXT,
- CHANGE MetaDescription MetaDescription TEXT;
+ CHANGE MetaDescription MetaDescription TEXT,
+ CHANGE CachedCategoryTemplate CachedTemplate VARCHAR(255) NOT NULL,
+ DROP CategoryTemplate;
+UPDATE Category SET l1_MenuTitle = l1_Name WHERE l1_MenuTitle = '' OR l1_MenuTitle LIKE '_Auto: %';
+UPDATE Category SET l2_MenuTitle = l2_Name WHERE l2_MenuTitle = '' OR l2_MenuTitle LIKE '_Auto: %';
+UPDATE Category SET l3_MenuTitle = l3_Name WHERE l3_MenuTitle = '' OR l3_MenuTitle LIKE '_Auto: %';
+UPDATE Category SET l4_MenuTitle = l4_Name WHERE l4_MenuTitle = '' OR l4_MenuTitle LIKE '_Auto: %';
+UPDATE Category SET l5_MenuTitle = l5_Name WHERE l5_MenuTitle = '' OR l5_MenuTitle LIKE '_Auto: %';
+
CREATE TABLE PageContent (
PageContentId int(11) NOT NULL auto_increment,
ContentNum int(11) NOT NULL default '0',
Index: branches/RC/core/units/categories/categories_config.php
===================================================================
diff -u -r11501 -r11504
--- branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 11501)
+++ branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 11504)
@@ -291,8 +291,7 @@
'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'),
'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
- 'CategoryTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
- 'CachedCategoryTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
// fields from Pages
@@ -304,7 +303,7 @@
LEFT JOIN ' . TABLE_PREFIX . 'Theme AS t ON t.ThemeId = tf.ThemeId
WHERE (t.Enabled = 1) AND (tf.FileName NOT LIKE "%%.elm.tpl") AND (tf.FilePath = "/designs")',
'option_key_field' => 'Value', 'option_title_field' => 'Title',
- 'required' => 1, 'default' => null
+ /*'required' => 1,*/ 'default' => null
),
'UseExternalUrl' => Array (
Index: branches/RC/core/admin_templates/img/itemicons/icon16_folder.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/core/units/categories/categories_event_handler.php
===================================================================
diff -u -r11501 -r11504
--- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11501)
+++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11504)
@@ -441,7 +441,7 @@
WHERE
(NamedParentPath = ' . $this->Conn->qstr($template) . ') OR
(NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
- (IsSystem = 1 AND Template = ' . $this->Conn->qstr($template) . ')';
+ (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')';
$page_id = $this->Conn->GetOne($sql);
}
else {
@@ -561,7 +561,7 @@
$live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true));
$live_object->Load($id);
- $cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId', 'Priority');
+ $cached_fields = Array('Name', 'Filename', 'Template', 'ParentId', 'Priority');
foreach ($cached_fields as $cached_field) {
if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) {
@@ -599,7 +599,7 @@
$object =& $event->getObject();
// 2. preset template
- $object->SetDBField('Template', $this->_getDefaultDesign());
+// $object->SetDBField('Template', $this->_getDefaultDesign());
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
@@ -1238,7 +1238,7 @@
$page =& $this->Application->recallObject($this->Prefix . '.-virtual', null, Array ('page' => $t));
if($page->isLoaded()) {
- $real_t = $page->GetDBField('Template');
+ $real_t = $page->GetDBField('CachedTemplate');
$this->Application->SetVar('m_cat_id', $page->GetDBField('CategoryId') );
if ($page->GetDBField('FormId')) {
$this->Application->SetVar('form_id', $page->GetDBField('FormId'));
@@ -1366,7 +1366,7 @@
$page_description = '';
if ($system) {
- $design_template = strtolower($template);
+ $design_template = strtolower($template); // leading "/" not added !
$template_info = $this->_getTemplateInfo($design_template, $theme_id);
if ($template_info) {
if (array_key_exists('name', $template_info) && $template_info['name']) {
@@ -1384,7 +1384,7 @@
}
}
else {
- $design_template = $this->_getDefaultDesign();
+ $design_template = $this->_getDefaultDesign(); // leading "/" added !
}
// put all templates to then end of list (in their category)
@@ -1411,7 +1411,8 @@
$object->SetDBField('IsMenu', 0);
$object->SetDBField('ThemeId', $system ? $theme_id : 0);
$object->SetDBField('Priority', $min_priority - 1);
- $object->SetDBField('Template', $design_template); // bug: possible case, when leading "/" is missing
+ $object->SetDBField('Template', $design_template);
+ $object->SetDBField('CachedTemplate', $design_template);
$primary_language = $this->Application->GetDefaultLanguageId();
$current_language = $this->Application->GetVar('m_lang');
Index: branches/RC/core/admin_templates/img/itemicons/icon16_folder-red.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/core/admin_templates/categories/categories_edit.tpl
===================================================================
diff -u -r11495 -r11504
--- branches/RC/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 11495)
+++ branches/RC/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 11504)
@@ -61,16 +61,8 @@