ultimix
page_composer_utilities_1_0_0 Class Reference

Public Member Functions

 __construct ()
 redirect_using_map (&$Options)
 output_trace_if_necessary (&$PageComposer)
 page_permit_validation (&$Options)
 get_template_for_package ($PageDescription)
 translate_template_name (&$PageComposer, &$PageDescription)

Data Fields

 $Cache = false
 $CachedMultyFS = false
 $PageComposer = false
 $PageCSS = false
 $PageJS = false
 $Security = false
 $String = false
 $Tags = false
 $TemplateManager = false
 $Trace = false

Detailed Description

Page composer utilities.

Author
Dodonov A.A.

Definition at line 26 of file page_composer_utilities.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 59 of file page_composer_utilities.php.

{
try
{
$this->Cache = get_package( 'cache' , 'last' , __FILE__ );
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->PageCSS = get_package( 'page::page_css' , 'last' , __FILE__ );
$this->PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->Tags = get_package( 'string::tags' , 'last' , __FILE__ );
$this->TemplateManager = get_package( 'template_manager' , 'last' , __FILE__ );
$this->Trace = get_package( 'trace' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

get_template_for_package (   $PageDescription)

Function gets template.

Parameters
$PageDescription- Page description.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 231 of file page_composer_utilities.php.

{
try
{
$this->TemplateName = $PageDescription[ 'template' ];
$this->TemplateVersion = $PageDescription[ 'template_version' ];
return( $this->TemplateManager->get_template( $this->TemplateName , $this->TemplateVersion ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
output_trace_if_necessary ( $PageComposer)

Function outputs trace if necessary.

Parameters
$PageComposer- Page composer.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 146 of file page_composer_utilities.php.

{
try
{
$AutoMarkup = get_package( 'page::auto_markup' , 'last' , __FILE__ );
if( $this->Security->get_gp( 'trace' , 'integer' , 0 ) )
{
$String = $PageComposer->Template->get_template();
$String = str_replace( '{trace}' , $this->Trace->compile_trace() , $String );
$String = $AutoMarkup->compile_string( $String );
$PageComposer->Template->set_template( $String );
}
elseif( $this->Security->get_gp( 'trace_only' , 'integer' , 0 ) )
{
$String = $this->Trace->compile_trace();
$String = $AutoMarkup->compile_string( $String );
print( $String );
exit( 0 );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
page_permit_validation ( $Options)

Validating permits.

Parameters
$Options- Settings.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 191 of file page_composer_utilities.php.

{
try
{
if( $Options->get_setting( 'page_permit_validation' , false ) )
{
$Permits = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$PageName = $this->Security->get_g( 'page_name' , 'command' );
if( $Permits->validate_permits_ex( false , 'user' , $PageName , 'page' ) === false )
{
header( 'Location: ./no_permits.html' );
exit( 1 );
}
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
redirect_using_map ( $Options)

Redirect.

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

Definition at line 97 of file page_composer_utilities.php.

{
try
{
$PageName = $this->Security->get_gp( 'page_name' , 'command' );
$RedirectPage = $Options->get_setting( $PageName , false );
if( $RedirectPage === false )
{
$RedirectPage = $Options->get_setting( '*' , false );
}
if( $RedirectPage === false )
{
return;
}
header( "HTTP/1.1 301 Moved Permanently" );
if( $RedirectPage == 'self' )
{
header( "Location: $PageName.html" );
}
else
{
header( "Location: ".$this->Security->get_srv( 'REQUEST_URI' , 'string' ) );
}
exit( 0 );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
translate_template_name ( $PageComposer,
$PageDescription 
)

Function loads template info.

Parameters
$PageComposer- Page composer.
$PageDescription- Page description.
Returns
Page description.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 272 of file page_composer_utilities.php.

{
try
{
$Default = $PageDescription[ 'template' ] == 'default';
$DefaultAdmin = $PageDescription[ 'template' ] == 'default_admin';
if( $Default || $DefaultAdmin )
{
$PageComposer->Template = $Default ?
$this->TemplateManager->get_default_template_name() :
$this->TemplateManager->get_default_admin_template_name();
$Data = array( $PageComposer->Template[ 'name' ] , $PageComposer->Template[ 'version' ] );
list( $PageDescription[ 'template' ] , $PageDescription[ 'template_version' ] ) = $Data;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Cache = false

Cached object.

Author
Dodonov A.A.

Definition at line 38 of file page_composer_utilities.php.

$CachedMultyFS = false

Definition at line 39 of file page_composer_utilities.php.

$PageComposer = false

Definition at line 40 of file page_composer_utilities.php.

$PageCSS = false

Definition at line 41 of file page_composer_utilities.php.

$PageJS = false

Definition at line 42 of file page_composer_utilities.php.

$Security = false

Definition at line 43 of file page_composer_utilities.php.

$String = false

Definition at line 44 of file page_composer_utilities.php.

$Tags = false

Definition at line 45 of file page_composer_utilities.php.

$TemplateManager = false

Definition at line 46 of file page_composer_utilities.php.

$Trace = false

Definition at line 47 of file page_composer_utilities.php.


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