Public Member Functions |
| | __construct () |
| | pre_generation ($Options) |
| | clear () |
| | add_context ($ContextPath) |
| | add_contexts (&$Options, $ContextFolder, $Contexts) |
| | get_update_record ($New, $Original) |
| | compile_prefix ($Str, $Changed) |
| | set_locations (&$Options, $AutoRedirect) |
| | run_execution ($Options, $Provider, $AutoRedirect=0) |
| | run_custom_states (&$Options) |
| | execute (&$Options, $Provider, $FilePath) |
| | compile_special_macro (&$Options, $Str, &$Changed) |
| | __toString () |
Detailed Description
Class for rapid controllers and viewes development.
- Author
- Dodonov A.A.
Definition at line 26 of file context_set.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 162 of file context_set.php.
{
try
{
$this->CommonStateStartup =
get_package(
'gui::context_set::common_state_startup' ,
'last' , __FILE__ );
$this->ContextSetConfigs =
get_package(
'gui::context_set::context_set_configs' ,
'last' , __FILE__ );
$this->CustomStateStartup =
get_package(
'gui::context_set::custom_state_startup' ,
'last' , __FILE__ );
$this->get_main_packages();
$this->get_additional_packages();
}
catch( Exception $e )
{
}
}
Member Function Documentation
Method converts object to string.
- Returns
- string with the object's description.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 813 of file context_set.php.
{
try
{
return( serialize( $this->Config ) );
}
catch( Exception $e )
{
}
}
| add_context |
( |
|
$ContextPath | ) |
|
Method adds non-standart context.
- Parameters
-
| $ContextPath | - Path to the context's config. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 253 of file context_set.php.
{
try
{
$this->Contexts [] = $ContextPath;
}
catch( Exception $e )
{
}
}
| add_contexts |
( |
& |
$Options, |
|
|
|
$ContextFolder, |
|
|
|
$Contexts |
|
) |
| |
Method adds non-standart contexts.
- Parameters
-
| $Options | - Options. |
| $ContextFolder | - Path to the directory. |
| $Contexts | - Contexts. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 291 of file context_set.php.
{
try
{
$HintedContext = $Options->get_setting( 'context' , false );
{
$this->Trace->add_trace_string( "Hinted context : $ContextFolder/conf/$HintedContext" , COMMON );
$this->Contexts [] = "$ContextFolder/conf/$HintedContext";
}
else
{
$this->Trace->add_trace_string( "Hinted context : all contexts" , COMMON );
{
$this->Contexts [] = "$ContextFolder/conf/$Context";
}
}
}
catch( Exception $e )
{
}
}
Method clears system structures.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 223 of file context_set.php.
{
try
{
$this->Contexts = array();
}
catch( Exception $e )
{
}
}
| compile_prefix |
( |
|
$Str, |
|
|
|
$Changed |
|
) |
| |
Method processes macro 'prefix'.
- Parameters
-
| $Str | - String to process. |
| $Changed | - true if any of the page's elements was compiled. |
- Returns
- array( Processed string , Was the string changed ).
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 398 of file context_set.php.
{
try
{
if( strpos( $Str , '{prefix}' ) !== false )
{
$Str = str_replace( '{prefix}' , $this->Prefix ,$Str );
$Changed = true;
}
return( array( $Str , $Changed ) );
}
catch( Exception $e )
{
}
}
| compile_special_macro |
( |
& |
$Options, |
|
|
|
$Str, |
|
|
& |
$Changed |
|
) |
| |
Method processes string.
- Parameters
-
| $Options | - Settings. |
| $Str | - String to process. |
| $Changed | - true if any of the page's elements was compiled. |
- Returns
- Processed string.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 779 of file context_set.php.
{
try
{
list( $Str , $Changed ) = $this->ContextSetMarkup->compile_options( $Options , $Str , $Changed );
$Str = str_replace( '{prefix}' , $this->Prefix , $Str );
return( $Str );
}
catch( Exception $e )
{
}
}
| execute |
( |
& |
$Options, |
|
|
|
$Provider, |
|
|
|
$FilePath |
|
) |
| |
Method starts controller/view.
- Parameters
-
| $Options | - Execution parameters. |
| $Provider | - Object of the class wich provides all handlers. |
| $FilePath | - Path tp the component. Must be equal to FILE |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 728 of file context_set.php.
{
try
{
$this->Trace->start_group(
"ContextSet::execute for class \"".get_class(
$Provider ).
"\"" );
$this->Trace->add_trace_string( serialize( $Options->get_raw_settings() ) , COMMON );
$Options->set_setting( 'file_path' , $FilePath );
$this->Provider->Output = false;
$this->execute_do( $Options ,
$Provider , $FilePath );
$this->Trace->end_group();
}
catch( Exception $e )
{
}
}
| get_update_record |
( |
|
$New, |
|
|
|
$Original |
|
) |
| |
Method returns update record.
- Parameters
-
| $New | - Record. |
| $Original | - Record. |
- Returns
- - Record.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 343 of file context_set.php.
{
try
{
$Update = array();
foreach( $New as $Field => $NewValue )
{
$Field = str_replace( $this->Prefix.'_' , '' , $Field );
if( @$Original->$Field == $NewValue )
{
continue;
}
if( @$Original->$Field != $this->Security->get( $NewValue , 'unsafe_string' ) )
{
@$Update[ $Field ] = $NewValue;
continue;
}
}
return( $Update );
}
catch( Exception $e )
{
}
}
| pre_generation |
( |
|
$Options | ) |
|
Method executes before any page generating actions took place.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 196 of file context_set.php.
{
try
{
$this->PageJS->add_javascript( "{http_host}/$Path/include/js/context_set.js" );
}
catch( Exception $e )
{
}
}
| run_custom_states |
( |
& |
$Options | ) |
|
Method starts controller/view.
- Parameters
-
| $Options | - Execution parameters. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 585 of file context_set.php.
{
try
{
$this->Trace->start_group( "custom_configs_processing" , COMMON );
foreach( $this->Contexts as $i => $ContextPath )
{
$this->Trace->add_trace_string( "Processing context $ContextPath" , COMMON );
$Config = $this->load_custom_settings( $ContextPath , $Options );
$Result = $this->CustomStateStartup->run_config_processors(
$this , $Config , $this->CustomSettings , $Options
);
if( $Result )
{
break;
}
}
$this->Trace->end_group();
}
catch( Exception $e )
{
}
}
| run_execution |
( |
|
$Options, |
|
|
|
$Provider, |
|
|
|
$AutoRedirect = 0 |
|
) |
| |
Method starts controller/view.
- Parameters
-
| $Options | - Execution parameters. |
| $Provider | - Object of the class wich provides all handlers. |
| $AutoRedirect | - Redirect page. |
- Returns
- true if the execution was successfull.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 494 of file context_set.php.
{
try
{
if( $this->Context->execute( $Options ,
$Provider ) )
{
$GUI->set_var( 'last_context_set_execution_code' , 0 );
$GUI->set_var(
'last_context_set_execution_message' , $this->Messages->get_last_success_message()
);
return( true );
}
$GUI->set_var( 'last_context_set_execution_code' , 1 );
$GUI->set_var(
'last_context_set_execution_message' , $this->Messages->get_last_error_message()
);
return( false );
}
catch( Exception $e )
{
}
}
| set_locations |
( |
& |
$Options, |
|
|
|
$AutoRedirect |
|
) |
| |
Function tries to redirect on another page.
- Parameters
-
| $Options | - Redirect settings. |
| $AutoRedirect | - Should be redirected. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 438 of file context_set.php.
{
try
{
$AutoRedirect = intval( $Options->get_setting( 'auto_redirect' , $AutoRedirect ) );
$AutoRedirect = $this->Security->get_gp( 'auto_redirect' , 'integer' , $AutoRedirect );
if( $AutoRedirect && $this->Security->get_srv( 'HTTP_REFERER' , 'set' ) )
{
header( $_SERVER[ 'SERVER_PROTOCOL' ].' 303 See Other' );
if( $Options->get_setting( 'redirect_page' , false ) )
{
header( "Location: ".$Options->get_setting( 'redirect_page' ) );
}
else
{
header( "Location: ".$this->Security->get_srv( 'HTTP_REFERER' , 'raw' ) );
}
exit( 0 );
}
}
catch( Exception $e )
{
}
}
Field Documentation
| $CommonStateStartup = false |
Paths to the non-standart contexts.
- Author
- Dodonov A.A.
Definition at line 85 of file context_set.php.
| $ContextSetConfigs = false |
| $ContextSetSettings = false |
| $CustomStateStartup = false |
Class'es object wich provides methods.
- Author
- Dodonov A.A.
Definition at line 73 of file context_set.php.
The documentation for this class was generated from the following file: