ultimix
page_markup_utilities_1_0_0 Class Reference

Public Member Functions

 __construct ()
 add_meta_parameters (&$Options)
 direct_controller (&$Options)
 wrap_control_view (&$Options, $ControlView)
 direct_view (&$Options)

Data Fields

 $CachedMultyFS = false
 $Security = false
 $Trace = false

Detailed Description

Class processes page's macro.

Author
Dodonov A.A.

Definition at line 26 of file page_markup_utilities.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 53 of file page_markup_utilities.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , '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

add_meta_parameters ( $Options)

Function adds meta parameters.

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

Definition at line 85 of file page_markup_utilities.php.

{
try
{
$PackageName = $Options->get_setting( 'package_name' );
$PackageVersion = $Options->get_setting( 'package_version' , 'last' );
if( $Options->get_setting( 'meta' , false ) !== false )
{
$PackagePath = _get_package_relative_path_ex( $PackageName , $PackageVersion );
$MetaFileName = $Options->get_setting( 'meta' );
$MetaSettings = $this->CachedMultyFS->file_get_contents( "$PackagePath/meta/$MetaFileName" );
$Options->append_settings( $MetaSettings );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
direct_controller ( $Options)

Function calls component's controller.

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

Definition at line 170 of file page_markup_utilities.php.

{
try
{
$this->Security->reset_s( 'direct_controller' , 1 );
$this->Trace->add_trace_string( '{lang:processing_direct_controller}' , COMMON );
$PackageName = $Options->get_setting( 'package_name' , false );
if( $PackageName !== false )
{
$PackageVersion = $Options->get_setting( 'package_version' , 'last' );
$Package = get_package( $PackageName , $PackageVersion , __FILE__ );
$this->add_meta_parameters( $Options );
$this->call_controller( $Package , $Options );
}
$this->Security->reset_s( 'direct_controller' , 0 );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
direct_view ( $Options)

Function draws component.

Parameters
$Options- Settings.
Returns
HTML code of the компонента.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 276 of file page_markup_utilities.php.

{
try
{
$PackageName = $Options->get_setting( 'package_name' , false );
$PackageVersion = $Options->get_setting( 'package_version' , 'last' );
if( $PackageName !== false )
{
$Package = get_package( $PackageName , $PackageVersion , __FILE__ );
$this->add_meta_parameters( $Options );
if( method_exists( $Package , 'view' ) === false )
{
throw( new Exception( 'Function "view" was not found for class '.get_class( $Package ) ) );
}
else
{
$ControlView = $Package->view( $Options );
return( $this->wrap_control_view( $Options , $ControlView ) );
}
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
wrap_control_view ( $Options,
  $ControlView 
)

Wrapping control in it's own div.

Parameters
$Options- Generation settings.
$ControlView- Generated control.
Returns
Control's HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 223 of file page_markup_utilities.php.

{
try
{
$Class = $Options->get_setting( 'wrapper_class' , false );
if( $Class !== false )
{
$Class = " class=\"$Class\"";
}
$Id = $Options->get_setting( 'wrapper_id' , false );
if( $Id !== false )
{
$Id = " id=\"$Id\"";
}
if( $Id || $Class )
{
$PlaceHolders = array( '{id}' , '{class}' , '{control_view}' );
$ViewWrapper = $this->CachedMultyFS->get_template( __FILE__ , 'view_wrapper.tpl' );
$ControlView = str_replace( $PlaceHolders , array( $Id , $Class , $ControlView ) , $ViewWrapper );
}
return( $ControlView );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached objects.

Author
Dodonov A.A.

Definition at line 39 of file page_markup_utilities.php.

$Security = false

Definition at line 40 of file page_markup_utilities.php.

$Trace = false

Definition at line 41 of file page_markup_utilities.php.


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