74 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
75 $PackageName =
'gui::context_set::context_set_configs';
76 $this->ContextSetConfigs =
get_package( $PackageName ,
'last' , __FILE__ );
77 $this->PermitAlgorithms =
get_package(
'permit::permit_algorithms' ,
'last' , __FILE__ );
79 $this->String =
get_package(
'string' ,
'last' , __FILE__ );
80 $this->Trace =
get_package(
'trace' ,
'last' , __FILE__ );
122 $PermitsFilter = $CommonStateConfig->get_setting(
'permits_filter' ,
'admin' );
123 $ValidatingPermits = $CommonStateConfig->get_setting(
'permits_validation' , $PermitsFilter );
125 $PermitValidationResult = $this->PermitAlgorithms->object_has_all_permits(
126 false ,
'user' , $ValidatingPermits
129 if( $PermitValidationResult )
133 $ButtonCode = $this->CachedMultyFS->get_template( __FILE__ ,
'toolbar_'.$Name.
'_button.tpl' );
135 return( $ButtonCode );
140 catch( Exception $e )
176 function get_config( &$ContextSetConfig , &$Options , $Name )
180 $Config = $this->ContextSetConfigs->load_common_state_config(
181 $ContextSetConfig ,
'common_state_config_'.$Name ,
'cfcxs_'.$Name ,
182 $Options->get_setting(
'file_path' )
187 catch( Exception $e )
227 if( strpos( $Code , chr( 123 ).
'search_button' ) ===
false )
232 $Config = $this->
get_config( $ContextSetConfig , $Options ,
'search_form' );
243 catch( Exception $e )
279 private function compile_button( &$Config , $Code , $ButtonName )
283 if( strpos( $Code ,
'{'.$ButtonName.
'_button}' ) !==
false )
285 $Code = str_replace(
'{'.$ButtonName.
'_button}' ,
'{'.$ButtonName.
'_button:p=1}' , $Code );
288 for( ; $Params = $this->String->get_macro_parameters( $Code , $ButtonName.
'_button' ) ; )
290 $this->Settings->load_settings( $Params );
294 $Code = str_replace(
'{'.$ButtonName.
"_button:$Params}" , $ButtonCode , $Code );
299 catch( Exception $e )
339 if( strpos( $Code , chr( 123 ).
'create_button' ) ===
false )
344 $Config = $this->
get_config( $ContextSetConfig , $Options ,
'create_form' );
346 return( $this->compile_button( $Config , $Code ,
'create' ) );
348 catch( Exception $e )
388 if( strpos( $Code , chr( 123 ).
'update_button' ) ===
false )
393 $Config = $this->
get_config( $ContextSetConfig , $Options ,
'update_form' );
395 return( $this->compile_button( $Config , $Code ,
'update' ) );
397 catch( Exception $e )
437 if( strpos( $Code , chr( 123 ).
'copy_button' ) ===
false )
442 $Config = $this->
get_config( $ContextSetConfig , $Options ,
'copy_form' );
444 return( $this->compile_button( $Config , $Code ,
'copy' ) );
446 catch( Exception $e )
486 if( strpos( $Code , chr( 123 ).
'delete_button' ) ===
false )
491 $Config = $this->
get_config( $ContextSetConfig , $Options ,
'delete_button' );
493 return( $this->compile_button( $Config , $Code ,
'delete' ) );
495 catch( Exception $e )
535 $this->Trace->start_group(
'compile_buttons' );
547 $this->Trace->end_group();
549 $Str = str_replace(
'{prefix}' , $ContextSetConfig->get_setting(
'prefix' ,
'' ) , $Str );
553 catch( Exception $e )