ultimix
jstree.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
26  class jstree_1_0_0{
27 
38  var $CachedMultyFS = false;
39  var $PageJS = false;
40  var $String = false;
41 
56  function __construct()
57  {
58  try
59  {
60  $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
61  $this->PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
62  $this->String = get_package( 'string' , 'last' , __FILE__ );
63  }
64  catch( Exception $e )
65  {
66  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
67  }
68  }
69 
88  function pre_generation( $Options )
89  {
90  try
91  {
92  $Path = _get_package_relative_path_ex( 'gui::jstree' , get_package_version_s( __CLASS__ ) );
93  $Path = "{http_host}/$Path/include/js";
94 
95  $this->PageJS->add_javascript( "$Path/jquery.jstree.js" );
96  $this->PageJS->add_javascript( "$Path/jquery.jstree.buttons.js" );
97  $this->PageJS->add_javascript( "$Path/jquery.jstree.autorun.default.js" );
98  $this->PageJS->add_javascript( "$Path/jquery.jstree.extractor.js" );
99  $this->PageJS->add_javascript( "$Path/jquery.jstree.autorun.default.js" );
100 
101  $Lang = get_package( 'lang' , 'last' , __FILE__ );
102  $Lang->include_strings_js( 'gui::jstree' );
103  }
104  catch( Exception $e )
105  {
106  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
107  }
108  }
109 
132  function compile_tree_control_buttons( &$Settings )
133  {
134  try
135  {
136  $Code = $this->CachedMultyFS->get_template( __FILE__ , 'tree_control_buttons.tpl' );
137 
138  $Selector = $Settings->get_setting( 'tree_control_selector' , '.tree_control' );
139  $Code = str_replace( '{tree_control_selector}' , $Selector , $Code );
140 
141  $DirectCategory = $Settings->get_setting( 'direct_category' , '14' );
142  $Code = str_replace( '{direct_category}' , $DirectCategory , $Code );
143 
144  $Code = $this->String->print_record( $Code , $Settings );
145 
146  return( $Code );
147  }
148  catch( Exception $e )
149  {
150  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
151  }
152  }
153  }
154 
155 ?>