Public Member Functions |
| | __construct () |
| | get_common_state_config (&$ContextSet, $Options, $StateName, $Suffix= '') |
| | trace_no_need_to_run_state_message ($StateName, $Prefix, $ContextAction) |
| | trace_config_was_not_found_message ($StateName) |
| | prepare_config (&$ContextSet, $Config, $StateName) |
| | run_controller_state (&$ContextSet, $Options, $StateName, $Config) |
| | prepare_options ($Options, $StateName, $Config) |
| | run_view_state (&$ContextSet, $Options, $StateName, $Config) |
| | try_run_controller_state (&$ContextSet, $Options, $StateName) |
| | try_run_view_state (&$ContextSet, $Options, $StateName) |
Detailed Description
Class for rapid buttons creation.
- Author
- Dodonov A.A.
Definition at line 26 of file common_state_startup_utilities.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 59 of file common_state_startup_utilities.php.
{
try
{
$this->ContextSetConfigs =
get_package(
'gui::context_set::context_set_configs' ,
'last' , __FILE__ );
$this->DefaultControllers =
get_package(
'gui::context_set::default_controllers' ,
'last' , __FILE__ );
$this->DefaultViews =
get_package(
'gui::context_set::default_views' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
$this->Trace =
get_package(
'trace' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| get_common_state_config |
( |
& |
$ContextSet, |
|
|
|
$Options, |
|
|
|
$StateName, |
|
|
|
$Suffix = '' |
|
) |
| |
Function loads common state's config.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Options | - Execution parameters. |
| $StateName | - State's name. |
| $Suffix | - Suffix. |
- Returns
- State's config.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 110 of file common_state_startup_utilities.php.
{
try
{
$FieldName = 'common_state_config_'.$StateName.$Suffix;
$FileName = 'cfcxs_'.$StateName.$Suffix;
return(
$this->ContextSetConfigs->get_common_state_config(
$ContextSet->ContextSetSettings , $FieldName , $FileName , $Options->get_setting( 'file_path' )
)
);
}
catch( Exception $e )
{
}
}
| prepare_config |
( |
& |
$ContextSet, |
|
|
|
$Config, |
|
|
|
$StateName |
|
) |
| |
Function prepares.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Config | - State's config. |
| $StateName | - State's name. |
- Returns
- Config.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 283 of file common_state_startup_utilities.php.
{
try
{
if( strpos( $Config , 'success_message=' ) === false )
{
$Config .= "\r\nsuccess_message=".$ContextSet->Prefix.'_'.$StateName.'_was_completed';
}
if( strpos( $Config , 'cleanup_fields=' ) === false )
{
$Config .= "\r\ncleanup_fields=".$ContextSet->Prefix."_action,".
$ContextSet->Prefix."_context_action";
}
if( strpos( $Config , 'success_func=' ) === false )
{
$Config .= "\r\nsuccess_func=$StateName";
}
return( $Config );
}
catch( Exception $e )
{
}
}
| prepare_options |
( |
|
$Options, |
|
|
|
$StateName, |
|
|
|
$Config |
|
) |
| |
Function prepares run options.
- Parameters
-
| $Options | - Execution parameters. |
| $StateName | - State's name. |
| $Config | - State's config. |
- Returns
- State's config.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 399 of file common_state_startup_utilities.php.
{
try
{
$this->LocalOptions->clear();
$this->LocalOptions->append_settings( $Config );
$this->LocalOptions->add_settings_from_object( $Options );
$this->LocalOptions->set_undefined( 'access_package_version' , 'last' );
if( strpos( $Config , 'success_func' ) === false )
{
$Suffix = '_form';
$Config .= "\r\nsuccess_func=".$StateName.$Suffix;
$this->LocalOptions->set_undefined( 'success_func' , $StateName.$Suffix );
}
return( $Config );
}
catch( Exception $e )
{
}
}
| run_controller_state |
( |
& |
$ContextSet, |
|
|
|
$Options, |
|
|
|
$StateName, |
|
|
|
$Config |
|
) |
| |
Function runs state-controller.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Options | - Execution parameters. |
| $StateName | - State's name. |
| $Config | - State's config. |
- Returns
- true if the state was executed.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 343 of file common_state_startup_utilities.php.
{
try
{
$Config = $this->
prepare_config( $ContextSet , $Config , $StateName );
$this->LocalOptions->clear();
$this->LocalOptions->append_settings( $Config );
$this->LocalOptions->add_settings_from_object( $Options );
$this->LocalOptions->set_undefined( 'access_package_version' , 'last' );
$this->LocalOptions->set_undefined( $StateName.'_func' , $StateName == 'copy' ? 'create' : $StateName );
$ContextSet->Context->load_raw_config( $Config );
if( $ContextSet->run_execution( $this->LocalOptions , $this->DefaultControllers , 1 ) )
{
return( true );
}
return( false );
}
catch( Exception $e )
{
}
}
| run_view_state |
( |
& |
$ContextSet, |
|
|
|
$Options, |
|
|
|
$StateName, |
|
|
|
$Config |
|
) |
| |
Function runs state-view.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Options | - Execution parameters. |
| $StateName | - State's name. |
| $Config | - State's config. |
- Returns
- true if the state was executed.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 457 of file common_state_startup_utilities.php.
{
try
{
$this->Trace->add_trace_string( '{lang:run_view_state}' , COMMON );
$ContextSet->Context->load_raw_config( $Config );
if( $ContextSet->Context->execute( $this->LocalOptions , $this->DefaultViews ) )
{
$this->Trace->add_trace_string( '{lang:run_view_state_true}' , COMMON );
return( true );
}
$this->Trace->add_trace_string( '{lang:run_view_state_false}' , COMMON );
return( false );
}
catch( Exception $e )
{
}
}
| trace_config_was_not_found_message |
( |
|
$StateName | ) |
|
Trace function.
- Parameters
-
| $StateName | - State's name. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 241 of file common_state_startup_utilities.php.
{
try
{
$this->Trace->add_trace_string( "State config was not found ( $StateName )" );
}
catch( Exception $e )
{
}
}
| trace_no_need_to_run_state_message |
( |
|
$StateName, |
|
|
|
$Prefix, |
|
|
|
$ContextAction |
|
) |
| |
Trace function.
- Parameters
-
| $StateName | - State name. |
| $Prefix | - Prefix. |
| $ContextAction | - Context action. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 201 of file common_state_startup_utilities.php.
{
try
{
$this->Trace->add_trace_string( '{lang:no_need_to_run_trace_message}' , COMMON );
if( strpos( $ContextAction , '_form' ) !== false )
{
$this->trace_field( $Prefix , 'context_action' , $ContextAction );
}
if( strpos( $ContextAction , '_form' ) === false )
{
$this->trace_field( $Prefix , 'action' , $StateName );
}
}
catch( Exception $e )
{
}
}
| try_run_controller_state |
( |
& |
$ContextSet, |
|
|
|
$Options, |
|
|
|
$StateName |
|
) |
| |
Function processes state-controller.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Options | - Execution parameters. |
| $StateName | - State's name. |
- Returns
- true if the state was processed.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 512 of file common_state_startup_utilities.php.
{
try
{
if( $Config !== false )
{
}
else
{
}
return( false );
}
catch( Exception $e )
{
}
}
| try_run_view_state |
( |
& |
$ContextSet, |
|
|
|
$Options, |
|
|
|
$StateName |
|
) |
| |
Function processes state-view.
- Parameters
-
| $ContextSet | - Set of contexts. |
| $Options | - Execution parameters. |
| $StateName | - State's name. |
- Returns
- true if the state was processed.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 565 of file common_state_startup_utilities.php.
{
try
{
if( $Config !== false )
{
return( $this->
run_view_state( $ContextSet , $Options , $StateName , $Config ) );
}
else
{
}
return( false );
}
catch( Exception $e )
{
}
}
Field Documentation
| $ContextSetConfigs = false |
| $DefaultControllers = false |
The documentation for this class was generated from the following file: