ultimix
category_view_templates.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 
27 
38  var $Output;
39 
50  var $BlockSettings = false;
51  var $CachedMultyFS = false;
52  var $CategoryAccess = false;
53  var $CategoryAlgorithms = false;
54  var $OwnershipAccess = false;
55  var $Security = false;
56  var $String = false;
57 
68  function __construct()
69  {
70  try
71  {
72  $this->BlockSettings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
73  $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
74  $this->CategoryAccess = get_package( 'category::category_access' , 'last' , __FILE__ );
75  $this->CategoryAlgorithms = get_package( 'category::category_algorithms' , 'last' , __FILE__ );
76  $this->OwnershipAccess = get_package( 'permit::ownership::ownership_access' , 'last' , __FILE__ );
77  $this->Security = get_package( 'security' , 'last' , __FILE__ );
78  $this->String = get_package( 'string' , 'last' , __FILE__ );
79  }
80  catch( Exception $e )
81  {
82  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
83  }
84  }
85 
104  function pre_generation( $Options )
105  {
106  try
107  {
108  }
109  catch( Exception $e )
110  {
111  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
112  }
113  }
114 
145  function load_template( $LoadedTemplates , &$Options , $TemplateName )
146  {
147  try
148  {
149  $Item = $Options->get_setting( $TemplateName.'_template' , $TemplateName.'_template.tpl' );
150 
151  $LoadedTemplates[ $TemplateName ] = $this->CachedMultyFS->get_template( __FILE__ , $Item );
152 
153  return( $LoadedTemplates );
154  }
155  catch( Exception $e )
156  {
157  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
158  }
159  }
160 
187  function get_default_category_structure_templates( $Options , $Templates = array() )
188  {
189  try
190  {
191  $DisplayTemplates = array();
192 
193  $DisplayTemplates = $this->load_template( $DisplayTemplates , $Options , 'start_tag' );
194 
195  $DisplayTemplates = $this->load_template( $DisplayTemplates , $Options , 'end_tag' );
196 
197  $DisplayTemplates = $this->load_template( $DisplayTemplates , $Options , 'start_item_tag' );
198 
199  $DisplayTemplates = $this->load_template( $DisplayTemplates , $Options , 'start_leaf_tag' );
200 
201  $DisplayTemplates = $this->load_template( $DisplayTemplates , $Options , 'end_item_tag' );
202 
203  extend( $DisplayTemplates , $Templates );
204 
205  return( $DisplayTemplates );
206  }
207  catch( Exception $e )
208  {
209  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
210  }
211  }
212 
235  function get_categories_catalogue_templates( $Templates = false )
236  {
237  try
238  {
239  $DisplayTemplates = array(
240  'start_tag' =>
241  $this->CachedMultyFS->get_template( __FILE__ , 'catalogue_start_tag_template.tpl' ) ,
242  'end_tag' =>
243  $this->CachedMultyFS->get_template( __FILE__ , 'catalogue_end_tag_template.tpl' ) ,
244  'start_item_tag' =>
245  $this->CachedMultyFS->get_template( __FILE__ , 'catalogue_start_item_tag_template.tpl' ) ,
246  'end_item_tag' =>
247  $this->CachedMultyFS->get_template( __FILE__ , 'catalogue_end_item_tag_template.tpl' )
248  );
249 
250  if( $Templates !== false )
251  {
252  extend( $DisplayTemplates , $Templates );
253  }
254 
255  return( $DisplayTemplates );
256  }
257  catch( Exception $e )
258  {
259  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
260  }
261  }
262 
289  function get_categories_catalogue_part_templates( $Options , $Templates = false )
290  {
291  try
292  {
293  $DisplayTemplates = array();
294 
295  $Item = $Options->get_setting( 'item_template' , 'item_template.tpl' );
296  $DisplayTemplates[ 'item' ] = $this->CachedMultyFS->get_template( __FILE__ , $Item );
297 
298  $Item = $Options->get_setting( 'leaf_template' , 'leaf_template.tpl' );
299  $DisplayTemplates[ 'leaf' ] = $this->CachedMultyFS->get_template( __FILE__ , $Item );
300 
301  if( $Templates !== false )
302  {
303  extend( $DisplayTemplates , $Templates );
304  }
305 
306  return( $DisplayTemplates );
307  }
308  catch( Exception $e )
309  {
310  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
311  }
312  }
313  }
314 ?>