Detailed Description
Class for rapid controllers and viewes development.
- Author
- Dodonov A.A.
Definition at line 26 of file context_utilities.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 57 of file context_utilities.php.
{
try
{
$this->Messages =
get_package(
'page::messages' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
$this->SecurityValidator =
get_package(
'security::security_validator' ,
'last' , __FILE__ );
$this->Trace =
get_package(
'trace' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| compile_get_post_filter |
( |
& |
$Config, |
|
|
& |
$Options |
|
) |
| |
Function validates GET/POST filters.
- Parameters
-
| $Config | - Config. |
| $Options | - Execution parameters. |
- Returns
- false if the filtration was not passed.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 390 of file context_utilities.php.
{
try
{
{
return( true );
}
$Filter = $this->
get_section( $Config ,
'get_post_filter' );
$this->Trace->add_trace_string( "{lang:get_post_filter} : $Filter" , COMMON );
if( $this->SecurityValidator->validate_fields( $Filter ) === false )
{
$this->print_get_post_filter_trace( $Filter );
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| compile_get_post_validation |
( |
& |
$Config, |
|
|
& |
$Options |
|
) |
| |
Function validates GET/POST data.
- Parameters
-
| $Options | - Execution parameters. |
- Returns
- false if the validation was not passed.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 438 of file context_utilities.php.
{
try
{
{
$GetPostValidation = $this->
get_section( $Config ,
'get_post_validation' );
return( $this->SecurityValidator->validate_fields( $GetPostValidation ) );
}
return( true );
}
catch( Exception $e )
{
}
}
| compile_no_permits |
( |
|
$Validation | ) |
|
Function validates permits.
- Parameters
-
| $Validation | - Permits validation script. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 90 of file context_utilities.php.
{
try
{
$this->Messages->add_error_message( 'no_permits' );
$this->Trace->add_trace_string(
"{lang:permits_validation_not_passed} : $Validation" , COMMON
);
$this->Trace->add_trace_string( "GET : ".wordwrap( serialize( $_GET ) ) , COMMON );
$this->Trace->add_trace_string( "POST : ".wordwrap( serialize( $_POST ) ) , COMMON );
}
catch( Exception $e )
{
}
}
| compile_success_messages |
( |
& |
$Options | ) |
|
Function processes success messages.
- Parameters
-
| $Options | - Execution parameters. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 306 of file context_utilities.php.
{
try
{
$SuccessMessage = $this->get_success_message( $Options );
if( $SuccessMessage !== false )
{
if( $this->Security->get_s( 'direct_controller' , 'integer' , 0 ) === 0 )
{
$PageName = $this->Security->get_gp( 'page_name' , 'command' );
$this->Security->reset_s( "$PageName:success_message" , $SuccessMessage );
}
$this->Messages->add_success_message( $SuccessMessage );
}
$this->compile_global_success_message();
}
catch( Exception $e )
{
}
}
| get_custom_validation_object |
( |
& |
$Config | ) |
|
Provider's custom validations.
- Returns
- Object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 475 of file context_utilities.php.
{
try
{
$Name = $this->
get_section( $Config ,
'custom_validation_package_name' ,
false );
if( $Name !== false )
{
$Version = $this->
get_section( $Config ,
'custom_validation_package_version' ,
'last' );
$ValidationObject =
get_package( $Name , $Version , __FILE__ );
}
else
{
$ValidationObject = $Owner;
}
return( $ValidationObject );
}
catch( Exception $e )
{
}
}
| get_section |
( |
& |
$Config, |
|
|
|
$SectionName, |
|
|
|
$Default = '_throw_exception' |
|
) |
| |
Function returns config section by it's name.
- Parameters
-
| $Config | - Config. |
| $SectionName | - Section's name. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 129 of file context_utilities.php.
{
try
{
if( isset( $Config[ $SectionName ] ) )
{
return( $Config[ $SectionName ] );
}
else
{
if( $Default == '_throw_exception' )
{
throw(
new Exception(
"Section \"$SectionName\" was not found in config ".wordwrap( serialize( $Config ) )
)
);
}
return( $Default );
}
}
catch( Exception $e )
{
}
}
| section_exists |
( |
& |
$Config, |
|
|
|
$SectionName |
|
) |
| |
Function validates section existance.
- Parameters
-
| $Config | - Config. |
| $SectionName | - Section's name. |
- Returns
- True if the section exists, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 182 of file context_utilities.php.
{
try
{
if( $Config === false )
{
throw( new Exception( 'Config was not set' ) );
}
if( isset( $Config[ $SectionName ] ) )
{
$this->Trace->add_trace_string( "{lang:section_was_found} : $SectionName" , COMMON );
}
else
{
$this->Trace->add_trace_string( "{lang:section_was_not_found} : $SectionName" , COMMON );
}
return( isset( $Config[ $SectionName ] ) );
}
catch( Exception $e )
{
}
}
Field Documentation
| $SecurityValidator = false |
The documentation for this class was generated from the following file: