ultimix
page_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_direct_controller (&$Settings)
 compile_direct_view (&$Settings)
 compile_redirect (&$Settings)
 compile_safe (&$Settings, $Data)
 compile_common_literals ($Names, $Str, $Changed)
 compile_front_page_literals ($Names, $Str, $Changed)
 compile_for_pages ($Settings, $Data)
 compile_not_for_pages ($Settings, $Data)
 compile_meta (&$Settings)

Data Fields

 $PageMarkupUtilities = false
 $Security = false

Detailed Description

Class processes page's macro.

Author
Dodonov A.A.

Definition at line 26 of file page_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 52 of file page_markup.php.

{
try
{
$this->PageMarkupUtilities = get_package(
'page::page_markup::page_markup_utilities' , 'last' , __FILE__
);
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_common_literals (   $Names,
  $Str,
  $Changed 
)

Function processes macro.

Parameters
$Names- Literals.
$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 262 of file page_markup.php.

{
try
{
foreach( $Names as $i => $Name )
{
if( strpos( $Str , '{'.$Name.'}' ) !== false )
{
$Code = "{settings:package_name=page::page_composer;name=$Name;config_file_name=cf_site}";
$Str = str_replace( '{'.$Name.'}' , $Code , $Str );
$Changed = true;
}
}
return( array( $Str , $Changed ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_direct_controller ( $Settings)

Function compiles macro 'direct_controller'.

Parameters
$Settings- Compilation parameters.
Returns
Widget.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 89 of file page_markup.php.

{
try
{
if( $Settings->get_setting( 'need_run' , 1 ) == 1 )
{
$this->PageMarkupUtilities->direct_controller( $Settings );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_direct_view ( $Settings)

Function compiles macro 'error_messages'.

Parameters
$Settings- Compilation parameters.
Returns
Widget.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 128 of file page_markup.php.

{
try
{
$this->Security->reset_s( 'direct_view' , true );
$Settings->set_undefined( 'view' , 1 );
$Code = '';
if( $Settings->get_setting( 'need_run' , 1 ) == 1 )
{
$Code = $this->PageMarkupUtilities->direct_view( $Settings );
}
$this->Security->reset_s( 'direct_view' , false );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_for_pages (   $Settings,
  $Data 
)

Function compiles macro 'for_pages'.

Parameters
$Settings- Parameters.
$Data- Данные.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 370 of file page_markup.php.

{
try
{
$Pages = explode( ',' , $Settings->get_setting( 'pages' ) );
$PageName = $this->Security->get_gp( 'page_name' , 'command' );
if( in_array( $PageName , $Pages ) )
{
return( $Data );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_front_page_literals (   $Names,
  $Str,
  $Changed 
)

Function processes macro.

Parameters
$Names- Literals.
$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 315 of file page_markup.php.

{
try
{
if( $this->Security->get_gp( 'page_name' , 'command' ) != 'index' )
{
return( array( $Str , $Changed ) );
}
foreach( $Names as $i => $Name )
{
if( strpos( $Str , '{'.$Name.'}' ) !== false )
{
$Code = '<h1>{settings:package_name=page::page_composer;name='.$Name.
';config_file_name=cf_site}</h1>';
$Str = str_replace( '{'.$Name.'}' , $Code , $Str );
$Changed = true;
}
}
return( array( $Str , $Changed ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_meta ( $Settings)

Function compiles macro 'meta'.

Parameters
$Settings- Compilation parameters.
Returns
Widget.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 553 of file page_markup.php.

{
try
{
$MetaSettings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$this->load_meta_settings( $Settings , $MetaSettings );
$Str = $this->run_meta_settings( $MetaSettings , $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_not_for_pages (   $Settings,
  $Data 
)

Function compiles macro 'for_pages'.

Parameters
$Settings- Parameters.
$Data- Данные.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 417 of file page_markup.php.

{
try
{
$Pages = explode( ',' , $Settings->get_setting( 'pages' ) );
$PageName = $this->Security->get_gp( 'page_name' , 'command' );
if( !in_array( $PageName , $Pages ) )
{
return( $Data );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_redirect ( $Settings)

Function compiles macro 'redirect'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 174 of file page_markup.php.

{
try
{
$NeedRedirect = intval( $Settings->get_setting( 'need_redirect' , 1 ) );
if( $NeedRedirect )
{
header( 'Location: '.$Settings->get_setting( 'page' ) );
exit( 0 );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_safe ( $Settings,
  $Data 
)

Function compiles macro 'safe'.

Parameters
$Settings- Parameters.
$Data- Данные.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 220 of file page_markup.php.

{
try
{
return( $this->Security->get( $Data , 'string' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$PageMarkupUtilities = false

Cached objects.

Author
Dodonov A.A.

Definition at line 39 of file page_markup.php.

$Security = false

Definition at line 40 of file page_markup.php.


The documentation for this class was generated from the following file: