ultimix
paginator3000.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 $CachedMultyFS = false;
39  var $PageCSS = false;
40  var $PageJS = false;
41 
56  function __construct()
57  {
58  try
59  {
60  $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
61  $this->PageCSS = get_package( 'page::page_css' , 'last' , __FILE__ );
62  $this->PageJS = get_package( 'page::page_js' , '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  $Page = _get_package_relative_path_ex( 'gui::paginator3000' , '1.0.0' );
93  $this->PageJS->add_javascript( "{http_host}/$Page/include/js/paginator3000.js" );
94  $this->PageCSS->add_stylesheet( "{http_host}/$Page/res/css/paginator3000.css" );
95  }
96  catch( Exception $e )
97  {
98  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
99  }
100  }
101 
124  function compile_paginator3000( &$Settings )
125  {
126  try
127  {
128  $Code = $this->CachedMultyFS->get_template( __FILE__ , 'paginator3000.tpl' );
129  $PlaceHolders = array(
130  '{id}' , '{page_count}' , '{visible_page_count}' , '{current_page}' , '{page_url}'
131  );
132  $Values = array(
133  $Settings->get_setting( 'id' , md5( microtime( true ) ) ) ,
134  $Settings->get_setting( 'page_count' ) ,
135  $Settings->get_setting( 'visible_page_count' , 10 ) ,
136  $Settings->get_setting( 'current_page' , 1 ) ,
137  $Settings->get_setting( 'page_url' )
138  );
139 
140  return( str_replace( $PlaceHolders , $Values , $Code ) );
141  }
142  catch( Exception $e )
143  {
144  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
145  }
146  }
147  }
148 
149 ?>