Skip to content

Commit

Permalink
allow to open a subset of taxonomy tree, e.g. /backoffice/advanced/ta…
Browse files Browse the repository at this point in the history
…xonomy?id=1
  • Loading branch information
norbertlaposa committed Dec 9, 2013
1 parent 193f063 commit 7fd422c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
35 changes: 35 additions & 0 deletions controllers/bo/component/taxonomy_menu.php
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion htaccess
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion templates/bo/component/taxonomy_menu.html
@@ -1,6 +1,6 @@
<!-- BEGIN: content -->
<ul class="simpleTree">
<li class="root"><a href="#0"><span>Root</span></a>
<li class="root"><a href="#{ROOT.id}"><span>{ROOT.title|htmlspecialchars}</span></a>

<!-- BEGIN: group -->
<ul>
Expand Down
12 changes: 10 additions & 2 deletions templates/bo/pages/taxonomy.html
Expand Up @@ -13,7 +13,7 @@
initialiseTaxonomyAddButton();
},
afterDblClick:function(node){
alert("text-"+$('span:first',node).text());
//alert("text-"+$('span:first',node).text());
},
afterMove:function(destination, source, position){
var source_node_id = $('a:first', source).attr('href').match("[0-9]{1,}$");
Expand Down Expand Up @@ -62,7 +62,15 @@
}

$(document).ready(function(){

<!-- BEGIN: submenu -->
$('#taxonomy_tree_menu .simpleTree a.node_id_{GET.id}').addClass('active open');
$('#taxonomy_tree_menu .simpleTree a.node_id_{GET.id}').parent().parent().addClass('active open');
$('#taxonomy_tree_menu .simpleTree li.root a').click(function() {
makeAjaxRequest('#sub_content', '/request/bo/component/taxonomy_edit~id={GET.id}~');
});
$('#button_add_subpage').show().attr('data-node_id', {GET.id});
initialiseTaxonomyAddButton()
<!-- END: submenu -->
initialiseMenuTaxonomyTree();

});
Expand Down

0 comments on commit 7fd422c

Please sign in to comment.