Detailed Description
Class processes page's messages.
- Author
- Dodonov A.A.
Definition at line 26 of file messages.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 79 of file messages.php.
{
try
{
$this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| add_error_message |
( |
|
$Message | ) |
|
Function adds error message to render queue.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 110 of file messages.php.
{
try
{
if( array_search( $Message , $this->ErrorMessages ) === false )
{
$this->ErrorMessages [] = $Message;
}
}
catch( Exception $e )
{
}
}
| add_success_message |
( |
|
$Message | ) |
|
Function adds notification message to render queue.
- Parameters
-
| $Message | - Success message. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 180 of file messages.php.
{
try
{
if( array_search( $Message , $this->SuccessMessages ) === false )
{
$this->SuccessMessages [] = $Message;
}
}
catch( Exception $e )
{
}
}
Function clears all messages.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 285 of file messages.php.
{
try
{
$this->SuccessMessages = array();
$this->ErrorMessages = array();
}
catch( Exception $e )
{
}
}
| compile_error_message |
( |
& |
$Settings | ) |
|
Function compiles macro 'error_messages'.
- Parameters
-
| $Settings | - Compilation parameters. |
- Returns
- Widget.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 368 of file messages.php.
{
try
{
$Code = '';
if( isset( $this->ErrorMessages[ 0 ] ) )
{
$StartingDiv = $this->CachedMultyFS->get_template( __FILE__ , 'error_start.tpl' );
$ClosingDiv = $this->CachedMultyFS->get_template( __FILE__ , 'error_end.tpl' );
$Messages = implode( '}'.$ClosingDiv.$StartingDiv.'{lang:' , $this->ErrorMessages );
$Code = $StartingDiv."{lang:$Messages}".$ClosingDiv;
$this->ErrorMessages = array();
}
return( $Code );
}
catch( Exception $e )
{
}
}
| compile_success_message |
( |
& |
$Settings | ) |
|
Function compiles macro 'success_messages'.
- Parameters
-
| $Settings | - Compilation parameters. |
- Returns
- Widget.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 320 of file messages.php.
{
try
{
$Code = '';
if( isset( $this->SuccessMessages[ 0 ] ) )
{
$StartingDiv = $this->CachedMultyFS->get_template( __FILE__ , 'success_start.tpl' );
$ClosingDiv = $this->CachedMultyFS->get_template( __FILE__ , 'success_end.tpl' );
$Messages = implode( '}'.$ClosingDiv.$StartingDiv.'{lang:' , $this->SuccessMessages );
$Code = $StartingDiv."{lang:$Messages}".$ClosingDiv;
$this->SuccessMessages = array();
}
return( $Code );
}
catch( Exception $e )
{
}
}
| get_last_error_message |
( |
| ) |
|
Function returns last error message.
- Returns
- Error message.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 143 of file messages.php.
{
try
{
if( isset( $this->ErrorMessages[ 0 ] ) )
{
return( $this->ErrorMessages[ count( $this->ErrorMessages ) - 1 ] );
}
else
{
return( 'message_was_not_found' );
}
}
catch( Exception $e )
{
}
}
| get_last_success_message |
( |
| ) |
|
Function returns last success message.
- Returns
- Success message.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 213 of file messages.php.
{
try
{
if( isset( $this->SuccessMessages[ 0 ] ) )
{
return( $this->SuccessMessages[ count( $this->SuccessMessages ) - 1 ] );
}
else
{
return( 'message_was_not_found' );
}
}
catch( Exception $e )
{
}
}
| get_success_message_from_session |
( |
| ) |
|
Function processes success messages.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 246 of file messages.php.
{
try
{
if( $this->Security->get_s( 'success_message' , 'set' ) )
{
$this->Security->unset_s( 'success_message' );
}
$PageName = $this->Security->get_gp( 'page_name' , 'command' );
if( $this->Security->get_s( "$PageName:success_message" , 'set' ) )
{
$FieldName = "$PageName:success_message";
$this->Security->unset_s( "$PageName:success_message" );
}
}
catch( Exception $e )
{
}
}
Field Documentation
Cached object.
- Author
- Dodonov A.A.
Definition at line 62 of file messages.php.
Array keeps all error messages.
- Author
- Dodonov A.A.
Definition at line 38 of file messages.php.
| $SuccessMessages = array() |
Array keeps all notification messages.
- Author
- Dodonov A.A.
Definition at line 50 of file messages.php.
The documentation for this class was generated from the following file: