<?php

include("_dirinfo.php");

include (PATH_TO_ROOT."init.php");
include (PATH_TO_ROOT."webhelp/_class/class.Extjs_tree.php");
//include (PATH_TO_ROOT."_support/class.UserSession.php");

//$UserSession = new UserSession($db);
$treeName = $_POST[treeName].'Admin';

$tree = new MakeTreeHelpAdmin($treeName);
$tree->SetTable($_POST[tree], DB_WARPIT_HELP, $treeName);
$tree->SetRootVisible('false')
	  ->setTitle('Help - Admin')
	  ->setContEdit('Edit')
	  ->setContAddTopic('Add topic')
	  ->setContAddCat('Add category')
	  //->setContAdd('Add child')
	  //->setContAddMain('Add sibling')
	  ->setContDelete('Delete')
	  ->setContSetFaq('Use in FAQ')
	  ->activateDD()
	  ->setEditable()
	  ->setTextPadding('6px')
	  ->addConfig('iconCls',"'icon-help-tab'")
	  //->addContItem('test cont','function(item){alert("USPEH!!!")}')
	  //->addtBarItem("{text:'don\\'t press! ',handler:function(){testTree.expandAll();}} ")
	 ;

?>


<?php
	
	echo $tree->CreateTree();
	echo $treeName.".on('dblclick',function(node){CallScript('webhelp/_forms/forms.helpGrid.php','id='+node.id+'&tabTitle='+node.text+'&table=".$_POST[tree]."');})";
?>


Ext.getCmp('west-panel').add(<?php echo $treeName; ?>).show();
	
