"ajax" : { "url" : "%data_url%", "data":function(n) { return { pid : n.attr ? n.attr("id") : "" }; } }, santaUpdateRegionSynchron("content","index.php?action=set_left_menu&leftmenu=%action_node%&id="+sel_node); structure_tree_click_node("%action_node%&id=" + currNodeId); start_interface.link_go("%action_node%&id=" + currNodeId);
"crrm" : { "move" : { "default_position" : "inside", "check_move" : function (m) { if (m.o[0].id=="index" || m.np[0].id=="%tree_id%") return false;//no index node drag && no drag to top return true; } } }, .bind("move_node.jstree", function (e, data) { var index=data.rslt.cp; $.post("%move_url%", { node : data.rslt.o.attr("id"), newParent:data.rslt.np.attr("id"), index:index}, function(data){ //santaUpdateRegion('west','index.php?action=get_left_menu'); }); }) "crrm", "dnd", //this.contextmenu.add('-'); "%link_orig%":{ "label": "%name%", "_class" : "%class%", "action": function (par) { var disabledForNodes = new String("%node_exclude%").split(","); if (jQuery.inArray( par.attr("id"), disabledForNodes)>-1) return; //%action% } } "create":false "create":{ "label" : "%add_context_label%", "action": function (par) { var disabledForNodes = %disabled4nodes%; if (jQuery.inArray( par.attr("id"), disabledForNodes)>-1) return; this.create(par); } } "delete":{ "label" : "[#common_delete#]", "_class" : "ic_delete", "_disabled": node.attr('rel')=='root'|| (jQuery.inArray( node.attr("id"), (new String ("%node_exclude%")).split(",")))>-1, "action":function (par){ var parentNode=jQuery.jstree._reference("#%tree_id%")._get_parent(par); //%action% } } if (par.attr("id")!="index") { $("#popup_msg_div").html('%confirm%?
'); $("#popup_msg_div").dialog({ resizable: false, height:140, modal: true, buttons: { "[#common_yes#]": function() { jspub_cookie_set("%cookie_name_tree%",""); $.post('%link%',{ node : par.attr("id")}, function(data){ var parentNode=jQuery.jstree._reference("#%tree_id%")._get_parent(par); var tref=jQuery.jstree._reference("#%tree_id%"); tref.select_node("#"+parentNode.attr("id"),true); $("#%tree_id%").jstree("remove","#"+par.attr("id")); var parentType = tref._get_type(parentNode); //set "leaf" type if parent node has no childs now (except root) if(parentType=='folder' && tref._get_children(parentNode).length==0) tref.set_type('default',parentNode); }); $(this).dialog("close"); }, "[#common_no#]": function() { $(this).dialog("close"); } } }); } $.post('%link%',{ node : par.attr("id")}, function(data){ santaUpdateRegion('west','index.php?action=get_left_menu'); }); $.post('%link%',{ node : par.attr("id")}, function(data){ santaUpdateRegion('west','index.php?action=get_left_menu'); }); $.post('%link%',{ node : par.attr("id")}, function(data){ santaUpdateRegion('west','index.php?action=get_left_menu'); }); .bind("create.jstree", function (e, data) { var pid=data.rslt.parent.attr("id"); if (typeof pid === "undefined") pid=0; $.post( "%add_action%", { "pid" : pid, //"position" : data.rslt.position, //"type" : data.rslt.obj.attr("rel") "name" : data.rslt.name, }, function (r) { if(r.errore_count){ $.jstree.rollback(data.rlbk); santaShowPopupHint('Error',r.errore_text); } else{ data.inst.set_type("folder", data.rslt.parent); var newid=r.result_message; $(data.rslt.obj).attr("id", newid); data.inst.select_node("#"+newid,true); } }, 'json' ).error(function(jqXHR, status, error) {r=jqXHR.responseText; santaShowPopupHint('Error',r)}); })