a_toolbar.DisableButton('upcat');
a_toolbar.DisableButton('homecat');
Index: branches/unlabeled/unlabeled-1.13.2/kernel/units/configuration/configuration_tag_processor.php
===================================================================
diff -u -N -r5215 -r5636
--- branches/unlabeled/unlabeled-1.13.2/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 5215)
+++ branches/unlabeled/unlabeled-1.13.2/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 5636)
@@ -148,37 +148,48 @@
*/
function CategoryPath($params)
{
+ $block_params['separator'] = $params['separator'];
+
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->ModuleRootCategory( Array() );
}
-
- $block_params['current'] = 1;
- $block_params['separator'] = $params['separator'];
+
if ($params['cat_id'] == 0) {
- $block_params['name'] = $params['rootcatblock'];
+ $block_params['cat_id'] = 0;
+ $block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
+ $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
else {
- $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
-
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
- $sql = 'SELECT CategoryId, ParentId, '.$ml_formatter->LangFieldName('Name').' AS Name
- FROM '.TABLE_PREFIX.'Category
- WHERE CategoryId = '.$params['cat_id'];
- $res = $this->Conn->GetRow($sql);
- if ($res === false) {
- // in case if category is deleted
- return '';
+ $navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
+
+ $id_field = $this->Application->getUnitOption('c', 'IDField');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+ $sql = 'SELECT '.$navbar_field.', ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$params['cat_id'];
+ $category_data = $this->Conn->GetRow($sql);
+ $ret = '';
+ if ($category_data) {
+ $category_names = explode('|', $category_data[$navbar_field]);
+ $category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
+
+ // add "Home" category at beginning of path
+ array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
+ array_unshift($category_ids, 0);
+
+ foreach ($category_ids as $category_pos => $category_id) {
+ $block_params['cat_id'] = $category_id;
+ $block_params['cat_name'] = $category_names[$category_pos];
+ $block_params['name'] = $this->SelectParam($params, 'render_as,block');
+
+ $this->Application->SetVar($this->Prefix.'_id', $category_id);
+ $ret .= $this->Application->ParseBlock($block_params, 1);
+ }
}
- $block_params['name'] = $params['block'];
- $block_params['cat_name'] = $res['Name'];
- $block_params['separator'] = $params['separator'];
- $block_params['cat_id'] = $res['CategoryId'];
- $next_params['separator'] = $params['separator'];
- $next_params['rootcatblock'] = $params['rootcatblock'];
- $next_params['block'] = $params['block'];
- $next_params['cat_id'] = $res['ParentId'];
- return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
+
+ return $ret;
}
}
Index: branches/unlabeled/unlabeled-1.28.2/core/units/categories/categories_tag_processor.php
===================================================================
diff -u -N -r5631 -r5636
--- branches/unlabeled/unlabeled-1.28.2/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5631)
+++ branches/unlabeled/unlabeled-1.28.2/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5636)
@@ -82,9 +82,7 @@
function RootCategoryName($params)
{
- $root_phrase = $this->Application->ConfigValue('Root_Name');
- $ret = $this->Application->Phrase($root_phrase);
- return $ret;
+ return $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
}
function CheckModuleRoot($params)
@@ -111,63 +109,63 @@
function CategoryPath($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
- $module =& $this->Application->recallObject('mod.'.$module_name);
- $module_root_cat = $module->GetDBField('RootCat');
+ $module_category_id = $this->Application->findModule('Name', $module_name, 'RootCat');
+ $module_item_id = $this->Application->GetVar($this->Application->findModule('Name', $module_name, 'Var').'_id');
- $block_params['current'] = 0;
$block_params['separator'] = $params['separator'];
- if(!isset($params['cat_id']))
- {
+ if (!isset($params['cat_id'])) {
$params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
- $block_params['current'] = 1;
}
- $product_id = $this->Application->GetVar('p_id');
- if ($product_id) {
- $block_params['current'] = 0;
- }
- $block_params['is_module_root'] = ($params['cat_id'] == $module_root_cat) ? 1 : 0;
-
- if($params['cat_id'] == 0)
- {
- $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock');
+ if ($params['cat_id'] == 0) {
+ $block_params['current'] = 1;
+ $block_params['cat_id'] = 0;
+ $block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
+ $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
- else
- {
- $block_params['name'] = $this->SelectParam($params,'render_as,block');
- // $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
- $sql = 'SELECT CategoryId, ParentId, '.$this->getTitleField().' AS Name
- FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').'
- WHERE CategoryId = '.$params['cat_id'];
- $res = $this->Conn->GetRow($sql);
- if ($res === false) {
- // in case if category is deleted
- return '';
+ else {
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ $navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
+
+ $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
+ $sql = 'SELECT '.$navbar_field.', ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$params['cat_id'];
+ $category_data = $this->Conn->GetRow($sql);
+ $ret = '';
+ if ($category_data) {
+ $category_names = explode('|', $category_data[$navbar_field]);
+ $category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
+
+ // add "Home" category at beginning of path
+ array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
+ array_unshift($category_ids, 0);
+
+ foreach ($category_ids as $category_pos => $category_id) {
+ $block_params['cat_id'] = $category_id;
+ $block_params['cat_name'] = $category_names[$category_pos];
+ $block_params['current'] = ($params['cat_id'] == $category_id) && !$module_item_id ? 1 : 0;
+ $block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
+ $block_params['name'] = $this->SelectParam($params, 'render_as,block');
+
+ // which block to parse as current ?
+ if ($block_params['is_module_root'] == 1) { // module root
+ $block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock,render_as');
+ }
+
+ if ($block_params['current'] == 1) { // current cat (label)
+ $block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock,render_as');
+ }
+
+ $this->Application->SetVar($this->Prefix.'_id', $category_id);
+ $ret .= $this->Application->ParseBlock($block_params, 1);
+ }
}
-
- $block_params['cat_name'] = $res['Name'];
- $block_params['cat_id'] = $res['CategoryId'];
-
- $parent_params = $params;
- $parent_params['cat_id'] = $res['ParentId'];
-
- // which block to parse as current ?
- if ($block_params['is_module_root'] == 1) { // module root
- $block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock');
- }
- if ($block_params['current'] == 1) { // current cat (label)
- $block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock');
- }
-
- $this->Application->SetVar($this->Prefix.'_id', $res['CategoryId']);
- $current_cat = $this->Application->ParseBlock($block_params, 1);
-
- $this->Application->SetVar($this->Prefix.'_id', $res['ParentId']);
- $parent_cat = $this->CategoryPath($parent_params);
-
- return $parent_cat.$current_cat;
+
+ return $ret;
}
}
Index: branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl
===================================================================
diff -u -N -r5560 -r5636
--- branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 5560)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 5636)
@@ -105,14 +105,13 @@
-
-
-
-
+
+
+
-
+
', 'ModuleRootCategory');">
|
Index: branches/unlabeled/unlabeled-1.13.2/core/units/configuration/configuration_tag_processor.php
===================================================================
diff -u -N -r5215 -r5636
--- branches/unlabeled/unlabeled-1.13.2/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 5215)
+++ branches/unlabeled/unlabeled-1.13.2/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 5636)
@@ -148,37 +148,48 @@
*/
function CategoryPath($params)
{
+ $block_params['separator'] = $params['separator'];
+
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->ModuleRootCategory( Array() );
}
-
- $block_params['current'] = 1;
- $block_params['separator'] = $params['separator'];
+
if ($params['cat_id'] == 0) {
- $block_params['name'] = $params['rootcatblock'];
+ $block_params['cat_id'] = 0;
+ $block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
+ $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
else {
- $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
-
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
- $sql = 'SELECT CategoryId, ParentId, '.$ml_formatter->LangFieldName('Name').' AS Name
- FROM '.TABLE_PREFIX.'Category
- WHERE CategoryId = '.$params['cat_id'];
- $res = $this->Conn->GetRow($sql);
- if ($res === false) {
- // in case if category is deleted
- return '';
+ $navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
+
+ $id_field = $this->Application->getUnitOption('c', 'IDField');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+ $sql = 'SELECT '.$navbar_field.', ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$params['cat_id'];
+ $category_data = $this->Conn->GetRow($sql);
+ $ret = '';
+ if ($category_data) {
+ $category_names = explode('|', $category_data[$navbar_field]);
+ $category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
+
+ // add "Home" category at beginning of path
+ array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
+ array_unshift($category_ids, 0);
+
+ foreach ($category_ids as $category_pos => $category_id) {
+ $block_params['cat_id'] = $category_id;
+ $block_params['cat_name'] = $category_names[$category_pos];
+ $block_params['name'] = $this->SelectParam($params, 'render_as,block');
+
+ $this->Application->SetVar($this->Prefix.'_id', $category_id);
+ $ret .= $this->Application->ParseBlock($block_params, 1);
+ }
}
- $block_params['name'] = $params['block'];
- $block_params['cat_name'] = $res['Name'];
- $block_params['separator'] = $params['separator'];
- $block_params['cat_id'] = $res['CategoryId'];
- $next_params['separator'] = $params['separator'];
- $next_params['rootcatblock'] = $params['rootcatblock'];
- $next_params['block'] = $params['block'];
- $next_params['cat_id'] = $res['ParentId'];
- return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
+
+ return $ret;
}
}
Index: branches/unlabeled/unlabeled-1.6.2/core/units/categories/cache_updater.php
===================================================================
diff -u -N -r5635 -r5636
--- branches/unlabeled/unlabeled-1.6.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 5635)
+++ branches/unlabeled/unlabeled-1.6.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 5636)
@@ -289,7 +289,7 @@
$i = 1;
while ($i <= $this->languageCount) {
- $fields_hash['l'.$i.'_CachedNavbar'] = implode('>', $data['titles'][$i]);
+ $fields_hash['l'.$i.'_CachedNavbar'] = implode('|', $data['titles'][$i]);
$i++;
}
Index: branches/unlabeled/unlabeled-1.6.2/kernel/units/categories/cache_updater.php
===================================================================
diff -u -N -r5635 -r5636
--- branches/unlabeled/unlabeled-1.6.2/kernel/units/categories/cache_updater.php (.../cache_updater.php) (revision 5635)
+++ branches/unlabeled/unlabeled-1.6.2/kernel/units/categories/cache_updater.php (.../cache_updater.php) (revision 5636)
@@ -289,7 +289,7 @@
$i = 1;
while ($i <= $this->languageCount) {
- $fields_hash['l'.$i.'_CachedNavbar'] = implode('>', $data['titles'][$i]);
+ $fields_hash['l'.$i.'_CachedNavbar'] = implode('|', $data['titles'][$i]);
$i++;
}
Index: branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js
===================================================================
diff -u -N -r5624 -r5636
--- branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5624)
+++ branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5636)
@@ -138,7 +138,7 @@
if (get_hidden_field('m_cat_id') == $cat_id) {
// it's the same category, then don't reload category list
- return true;
+ return ;
}
set_hidden_field('m_cat_id', $cat_id);
}
Index: branches/unlabeled/unlabeled-1.61.2/core/kernel/processors/main_processor.php
===================================================================
diff -u -N -r5507 -r5636
--- branches/unlabeled/unlabeled-1.61.2/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 5507)
+++ branches/unlabeled/unlabeled-1.61.2/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 5636)
@@ -858,6 +858,12 @@
$lang =& $this->Application->recallObject('lang.current');
header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
}
+
+ function RootCategoryName($params)
+ {
+ $root_phrase = $this->Application->ConfigValue('Root_Name');
+ return $this->Application->Phrase($root_phrase);
+ }
}
Index: branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js
===================================================================
diff -u -N -r5624 -r5636
--- branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5624)
+++ branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5636)
@@ -138,7 +138,7 @@
if (get_hidden_field('m_cat_id') == $cat_id) {
// it's the same category, then don't reload category list
- return true;
+ return ;
}
set_hidden_field('m_cat_id', $cat_id);
}
Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/permissions/permissions_tag_processor.php
===================================================================
diff -u -N -r5614 -r5636
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 5614)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 5636)
@@ -164,10 +164,11 @@
if ($category_id > 0) {
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
- $sql = 'SELECT CachedNavbar
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').'
FROM '.$table_name.'
WHERE '.$id_field.' = '.$category_id;
- $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).'>'.$this->Conn->GetOne($sql), '>');
+ $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).' > '.str_replace('|', ' > ', $this->Conn->GetOne($sql)), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
Index: branches/unlabeled/unlabeled-1.8.2/core/units/permissions/permissions_tag_processor.php
===================================================================
diff -u -N -r5614 -r5636
--- branches/unlabeled/unlabeled-1.8.2/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 5614)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 5636)
@@ -164,10 +164,11 @@
if ($category_id > 0) {
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
- $sql = 'SELECT CachedNavbar
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').'
FROM '.$table_name.'
WHERE '.$id_field.' = '.$category_id;
- $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).'>'.$this->Conn->GetOne($sql), '>');
+ $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).' > '.str_replace('|', ' > ', $this->Conn->GetOne($sql)), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );