From 7fd422c8c6864602f89eef8cc40d9984cbd66526 Mon Sep 17 00:00:00 2001 From: Norbert Laposa Date: Mon, 9 Dec 2013 13:34:23 +0000 Subject: [PATCH] allow to open a subset of taxonomy tree, e.g. /backoffice/advanced/taxonomy?id=1 --- controllers/bo/component/taxonomy_menu.php | 35 ++++++++++++++++++++++ htaccess | 2 +- templates/bo/component/taxonomy_menu.html | 2 +- templates/bo/pages/taxonomy.html | 12 ++++++-- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/controllers/bo/component/taxonomy_menu.php b/controllers/bo/component/taxonomy_menu.php index 2271970c1..9241c57ff 100644 --- a/controllers/bo/component/taxonomy_menu.php +++ b/controllers/bo/component/taxonomy_menu.php @@ -11,6 +11,41 @@ class Onxshop_Controller_Bo_Component_Taxonomy_Menu extends Onxshop_Controller_Component_Menu_Js { + /** + * main action + */ + + public function mainAction() { + + /** + * root folder name + */ + + if (is_numeric($this->GET['id'])) { + + require_once('models/common/common_taxonomy.php'); + $Taxonomy = new common_taxonomy(); + + $item_detail = $Taxonomy->taxonomyItemDetail($this->GET['id']); + + $root = array('id'=>$this->GET['id'], 'title'=>$item_detail['label']['title']); + + } else { + + $root = array('id'=>0, 'title'=>'Root'); + + } + + $this->tpl->assign('ROOT', $root); + + /** + * standard action + */ + + return parent::mainAction(); + + } + /** * get list */ diff --git a/htaccess b/htaccess index 9b88262d4..e41ed9d7e 100644 --- a/htaccess +++ b/htaccess @@ -31,7 +31,7 @@ RewriteRule ^backoffice/surveys$ /index.php?request=sys/html5.bo/backoffic RewriteRule ^backoffice/marketing$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/marketing [L,QSA] RewriteRule ^backoffice/advanced/media$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/advanced.bo/pages/server_browser [L,QSA] -RewriteRule ^backoffice/advanced/taxonomy$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/advanced.bo/pages/taxonomy.bo/component/taxonomy_edit [L] +RewriteRule ^backoffice/advanced/taxonomy$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/advanced.bo/pages/taxonomy.bo/component/taxonomy_edit [L,QSA] RewriteRule ^backoffice/advanced/taxonomy/properties/([0-9]*)$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/advanced.bo/pages/taxonomy~id=$1~.bo/component/taxonomy_edit~id=$1~ [L] RewriteRule ^backoffice/advanced/taxonomy/add/([0-9]*)$ /index.php?request=sys/html5.bo/backoffice_wrapper.bo/backoffice.bo/pages/advanced.bo/pages/taxonomy~id=$1~.bo/component/taxonomy_add~parent=$1~ [L] diff --git a/templates/bo/component/taxonomy_menu.html b/templates/bo/component/taxonomy_menu.html index df533b351..e130d053c 100644 --- a/templates/bo/component/taxonomy_menu.html +++ b/templates/bo/component/taxonomy_menu.html @@ -1,6 +1,6 @@