Index: branches/RC/core/units/categories/categories_tag_processor.php
===================================================================
diff -u -r11520 -r11523
--- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11520)
+++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11523)
@@ -1020,9 +1020,17 @@
if (!$structure_path_match && !$design_match) {
// Same sql like in "c:getPassedID". Load, when current page object doesn't match requested page object
+ $themes_helper =& $this->Application->recallObject('ThemesHelper');
+ /* @var $themes_helper kThemesHelper */
+
$sql = 'SELECT ' . $page->IDField . '
FROM ' . $page->TableName . '
- WHERE (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')';
+ WHERE
+ (
+ (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
+ (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')
+ )
+ AND (ThemeId = ' . $themes_helper->getCurrentThemeId() . ' OR ThemeId = 0)';
$page_id = $this->Conn->GetOne($sql);
$page->Load($page_id);
Index: branches/RC/core/install/upgrades.sql
===================================================================
diff -u -r11504 -r11523
--- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11504)
+++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11523)
@@ -1032,6 +1032,8 @@
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: %';
+UPDATE Category SET Template = '/platform/designs/default_design.des' WHERE Template = '/in-edit/designs/general';
+UPDATE Category SET CachedTemplate = '/platform/designs/default_design.des' WHERE CachedTemplate = '/in-edit/designs/general';
CREATE TABLE PageContent (
PageContentId int(11) NOT NULL auto_increment,
Index: branches/RC/themes/default2009/platform/my_account/my_favorites.tpl
===================================================================
diff -u -r11494 -r11523
--- branches/RC/themes/default2009/platform/my_account/my_favorites.tpl (.../my_favorites.tpl) (revision 11494)
+++ branches/RC/themes/default2009/platform/my_account/my_favorites.tpl (.../my_favorites.tpl) (revision 11523)
@@ -32,7 +32,7 @@
-
+
Index: branches/RC/core/units/categories/categories_event_handler.php
===================================================================
diff -u -r11504 -r11523
--- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11504)
+++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11523)
@@ -439,9 +439,12 @@
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE
- (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR
- (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
- (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')';
+ (
+ (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR
+ (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
+ (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')
+ ) AND (ThemeId = ' . $this->_getCurrentThemeId() . ' OR ThemeId = 0)';
+
$page_id = $this->Conn->GetOne($sql);
}
else {
Index: branches/RC/core/install/upgrades.php
===================================================================
diff -u -r11501 -r11523
--- branches/RC/core/install/upgrades.php (.../upgrades.php) (revision 11501)
+++ branches/RC/core/install/upgrades.php (.../upgrades.php) (revision 11523)
@@ -679,40 +679,63 @@
}
if ($mode == 'after') {
- $skin =& $this->Application->recallObject('skin', null, Array ('skip_autoload' => 1));
- /* @var $skin kDBItem */
+ $this->_fixSkinColors();
+ $this->_restructureCatalog();
+ }
+ }
- $skin->Load(1, 'IsPrimary');
- if ($skin->isLoaded()) {
- $skin_options = unserialize( $skin->GetDBField('Options') );
+ /**
+ * Move all categories (except "Content") from "Home" to "Content" category and hide them from menu
+ *
+ */
+ function _restructureCatalog()
+ {
+ $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
- $changes = Array (
- // option: from -> to
- 'HeadBgColor' => Array ('#1961B8', '#007BF4'),
- 'HeadBarColor' => Array ('#FFFFFF', '#000000'),
- );
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'Category
+ SET IsMenu = 0, ParentId = ' . $root_category . '
+ WHERE ParentId = 0 AND CategoryId <> ' . $root_category;
+ $this->Conn->Query($sql);
+ }
- $can_change = true;
- foreach ($changes as $option_name => $change) {
- list ($change_from, $change_to) = $change;
+ /**
+ * Changes skin colors to match new ones (only in case, when they match default values)
+ *
+ */
+ function _fixSkinColors()
+ {
+ $skin =& $this->Application->recallObject('skin', null, Array ('skip_autoload' => 1));
+ /* @var $skin kDBItem */
- $can_change = $can_change && ($change_from == $skin_options[$option_name]['Value']);
- if ($can_change) {
- $skin_options[$option_name]['Value'] = $change_to;
- }
- }
+ $skin->Load(1, 'IsPrimary');
+ if ($skin->isLoaded()) {
+ $skin_options = unserialize( $skin->GetDBField('Options') );
- if ($can_change) {
- $skin->SetDBField('Options', serialize($skin_options));
- $skin->Update();
+ $changes = Array (
+ // option: from -> to
+ 'HeadBgColor' => Array ('#1961B8', '#007BF4'),
+ 'HeadBarColor' => Array ('#FFFFFF', '#000000'),
+ );
- $skin_eh =& $this->Application->recallObject('skin_EventHandler');
- /* @var $skin_eh SkinEventHandler */
+ $can_change = true;
+ foreach ($changes as $option_name => $change) {
+ list ($change_from, $change_to) = $change;
- $skin_eh->Compile($skin);
+ $can_change = $can_change && ($change_from == $skin_options[$option_name]['Value']);
+ if ($can_change) {
+ $skin_options[$option_name]['Value'] = $change_to;
}
}
+ if ($can_change) {
+ $skin->SetDBField('Options', serialize($skin_options));
+ $skin->Update();
+
+ $skin_eh =& $this->Application->recallObject('skin_EventHandler');
+ /* @var $skin_eh SkinEventHandler */
+
+ $skin_eh->Compile($skin);
+ }
}
}