ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
page_composer_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| pre_generation (&$Options)
| prepare_page_generation ($PageName)
| fetch_page_data (&$Page, $PageName, $PageDescription)
| generation_loop ($PageName, $PageDescription)
| get_page ($PageName)
| view (&$Options)

## Data Fields
| $TemplateName = ''
| $TemplateVersion = ''
| $Layout = 'default'
| $Template = false
| $Packages = false
| $AutoMarkup = false
| $Messages = false
| $PageAccess = false
| $PageComposerUtilities = false
| $PageCSS = false
| $PageJS = false
| $PageMarkup = false
| $PageMeta = false
| $PageParts = false
| $Security = false
| $String = false
| $Trace = false

## Detailed Description

Page composer.

Note
  There must be only one template per page, but each page may has each own template.

Author
  Dodonov A.A.

Definition at line 30 of file page_composer.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 162 of file page_composer.php.

{
try
{
$this->Messages = get_package( 'page::messages' , 'last' , __FILE__ );
$this->load_page_packages();
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->String = get_package( 'string' , '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

fetch_page_data | ( | & | $Page,
|  |  | $PageName,
|  |  | $PageDescription
| ) |  |

Function fetches page generation data.

Parameters

  $Page | - Page object.
  $PageName | - Name of the composing page.
  $PageDescription | - Page description.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 347 of file page_composer.php.

{
try
{
$this->Trace->add_trace_string( "{lang:fetching_data} : $PageName" , COMMON );
$this->Template = $this->PageComposerUtilities->get_template_for_package( $PageDescription );
$this->set_page_meta_info( $PageDescription );
$Options = $PageDescription[ 'options' ];
$this->Packages = $this->PageParts->get_package_appliance( $Page , $PageName , $Options );
$this->load_layout( $PageDescription );
$this->PageParts->fetch_packages( $this->Packages , $this->Template );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

generation_loop | ( |  | $PageName,
|  |  | $PageDescription
| ) |  |

Function generates page.

Parameters

  $PageName | - Name of the composing page.
  $PageDescription | - Page description.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 520 of file page_composer.php.

{
try
{
$this->Trace->add_trace_string( "{lang:run_generation_loop} : $PageName" , COMMON );
$this->before_generation( $this->Template , $PageDescription );
$this->Template->process( $PageName );
$this->PageParts->compile_controllers( $this->Packages );
$this->PageParts->compile_views( $this->Packages , $this->Template );
$this->after_generation( $this->Template , $PageDescription );
$this->Template->cleanup( $PageName , $PageDescription[ 'options' ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_page | ( |  | $PageName | ) |

Function starts page composition.

Parameters

  $PageName | - Name of the composing page.

Returns
  HTML code of the composed page.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 565 of file page_composer.php.

{
try
{
$PageDescription = $this->prepare_page_generation( $PageName );
if( $PageDescription !== false )
{
$this->Trace->add_trace_string( "{lang:page_generation_start} : $PageName" , COMMON );
$this->fetch_page_data( $this->PageAccess , $PageName , $PageDescription );
$this->generation_loop( $PageName , $PageDescription );
return( $this->Template->get_template() );
}
$this->Trace->add_trace_string( "{lang:requested_page_was_not_found} : $PageName" , ERROR );
return( $this->get_page( '404' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

pre_generation | ( | & | $Options | ) |

Function executes before any page generating actions took place.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 196 of file page_composer.php.

{
try
{
$PackagePath = _get_package_relative_path_ex( 'page::page_composer' , '1.0.0' );
$this->PageCSS->add_stylesheet( "{http_host}/$PackagePath/res/css/core.css" );
$Lang = get_package( 'lang' , 'last' , __FILE__ );
$Lang->include_strings_js( 'page::page_composer' );
$this->PageComposerUtilities->page_permit_validation( $Options );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

prepare_page_generation | ( |  | $PageName | ) |

Function prepares page generation.

Parameters

  $PageName | - Name of the composing page.

Returns
  Page description.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 236 of file page_composer.php.

{
try
{
if( GZIP_TRAFFIC )
{
@ob_start( 'ob_gzhandler' , 9 );
}
$this->Messages->get_success_message_from_session();
$PageDescription = $this->PageAccess->get_page_description( $PageName );
$this->PageComposerUtilities->translate_template_name( $this , $PageDescription );
return( $PageDescription );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

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 613 of file page_composer.php.

{
try
{
$PageMarkupUtilities = get_package(
'page::page_markup::page_markup_utilities' , 'last' , __FILE__
);
if( $Options->get_setting( 'direct_view' , false ) )
{
$Options->load_from_http();
return( $PageMarkupUtilities->direct_view( $Options ) );
}
if( $Options->get_setting( 'direct_controller' , false ) )
{
$Options->load_from_http();
$PageMarkupUtilities->direct_controller( $Options );
return;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$AutoMarkup = false

Cached object.

Author
  Dodonov A.A.

Definition at line 102 of file page_composer.php.

$Layout = 'default'

Page's layout.

Author
  Dodonov A.A.

Definition at line 66 of file page_composer.php.

$Messages = false

Definition at line 103 of file page_composer.php.

$Packages = false

Packages of the generating page.

Author
  Dodonov A.A.

Definition at line 90 of file page_composer.php.

$PageAccess = false

Definition at line 104 of file page_composer.php.

$PageComposerUtilities = false

Definition at line 105 of file page_composer.php.

$PageCSS = false

Definition at line 106 of file page_composer.php.

$PageJS = false

Definition at line 107 of file page_composer.php.

$PageMarkup = false

Definition at line 108 of file page_composer.php.

$PageMeta = false

Definition at line 109 of file page_composer.php.

$PageParts = false

Definition at line 110 of file page_composer.php.

$Security = false

Definition at line 111 of file page_composer.php.

$String = false

Definition at line 112 of file page_composer.php.

$Template = false

Template for the page.

Author
  Dodonov A.A.

Definition at line 78 of file page_composer.php.

$TemplateName = ''

Template's package.

Author
  Dodonov A.A.

Definition at line 42 of file page_composer.php.

$TemplateVersion = ''

Template's Version.

Author
  Dodonov A.A.

Definition at line 54 of file page_composer.php.

$Trace = false

Definition at line 113 of file page_composer.php.

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

- packages/page/packages/page_composer/page_composer.php