ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

public_common_state_startup.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 public_common_state_startup_1_0_0{
27
38 var $StartupUtilities = false;
39 var $DefaultControllers = false;
40 var $DefaultViews = false;
41 var $LocalOptions = false;
42 var $Security = false;
43 var $Trace = false;
44
55 var $Prefix = false;
56
71 function __construct()
72 {
73 try
74 {
75 $PackageName = 'gui::context_set::common_state_startup::common_state_startup_utilities';
76 $this->StartupUtilities = get_package( $PackageName , 'last' , __FILE__ );
77 $this->DefaultControllers = get_package( 'gui::context_set::default_controllers' , 'last' , __FILE__ );
78 $this->DefaultViews = get_package( 'gui::context_set::default_views' , 'last' , __FILE__ );
79 $this->LocalOptions = get_package_object( 'settings::settings' , 'last' , __FILE__ );
80 $this->Security = get_package( 'security' , 'last' , __FILE__ );
81 $this->Trace = get_package( 'trace' , 'last' , __FILE__ );
82 }
83 catch( Exception $e )
84 {
85 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
86 }
87 }
88
111 function set_constants( &$ContextSet , &$Options )
112 {
113 try
114 {
115 $this->Prefix = $ContextSet->Prefix;
116 $this->DefaultControllers->set_constants( $ContextSet , $Options );
117 $this->DefaultViews->set_constants( $ContextSet , $Options );
118 }
119 catch( Exception $e )
120 {
121 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
122 }
123 }
124
151 function last_records_form_state_startup( &$ContextSet , &$Options )
152 {
153 try
154 {
155 $this->Trace->start_group( "{lang:last_records_form_state}" );
156
157 $Result = false;
158
159 if( intval( $Options->get_setting( 'last_records' , 0 ) ) )
160 {
161 $Result = $this->StartupUtilities->try_run_view_state( $ContextSet , $Options , 'last_records' );
162 }
163 else
164 {
165 $this->StartupUtilities->trace_no_need_to_run_state_message(
166 'last_records_form' , $this->Prefix , ''
167 );
168 }
169
170 $this->Trace->end_group();
171 return( $Result );
172 }
173 catch( Exception $e )
174 {
175 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
176 }
177 }
178
205 function dependent_records_form_state_startup( &$ContextSet , &$Options )
206 {
207 try
208 {
209 $this->Trace->start_group( "{lang:dependent_records_form_state}" );
210
211 $Result = false;
212
213 if( intval( $Options->get_setting( 'dependent_records' , 0 ) ) )
214 {
215 $Result = $this->StartupUtilities->try_run_view_state(
216 $ContextSet , $Options , 'dependent_records'
217 );
218 }
219 else
220 {
221 $this->StartupUtilities->trace_no_need_to_run_state_message(
222 'dependent_records_form' , $this->Prefix , ''
223 );
224 }
225
226 $this->Trace->end_group();
227 return( $Result );
228 }
229 catch( Exception $e )
230 {
231 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
232 }
233 }
234
261 private function run_it( &$Options , $State )
262 {
263 try
264 {
265 $HintedContext = $Options->get_setting( 'common_context' , false );
266
267 if( $HintedContext === false )
268 {
269 return( true );
270 }
271
272 return( $HintedContext == $State );
273 }
274 catch( Exception $e )
275 {
276 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
277 }
278 }
279
306 function run_public_commmon_states( &$ContextSet , &$Options )
307 {
308 try
309 {
310 $this->set_constants( $ContextSet , $Options );
311
312 if( $this->last_records_form_state_startup( $ContextSet , $Options ) !== false )return( true );
313
314 if( $this->dependent_records_form_state_startup( $ContextSet , $Options ) !== false )return( true );
315
316 return( false );
317 }
318 catch( Exception $e )
319 {
320 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
321 }
322 }
323 }
324
325 ?>