Public Member Functions |
| | __construct () |
| | throw_method_was_not_found_exception ($p, $FunctionName) |
| | get_settings_for_package ($PackageName, $PackageVersion) |
| | get_controller ($PackageName, $PackageVersion) |
| | get_view ($PackageName, $PackageVersion) |
| | get_package_appliance ($Page, $PageName, $PageOptions) |
| | load_settings_for_package (&$Package, &$Template) |
| | fetch_packages (&$Packages, &$Template) |
| | execute_generators (&$Packages, $Type, &$Template) |
| | compile_controllers (&$Packages) |
| | compile_views (&$Packages, &$Template) |
Detailed Description
Page composer utilities.
- Author
- Dodonov A.A.
Definition at line 26 of file page_parts.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 56 of file page_parts.php.
{
try
{
$this->Cache =
get_package(
'cache' ,
'last' , __FILE__ );
$this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
'page::page_markup::page_markup_utilities' , 'last' , __FILE__
);
$this->String =
get_package(
'string' ,
'last' , __FILE__ );
$this->Trace =
get_package(
'trace' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| compile_controllers |
( |
& |
$Packages | ) |
|
Function processes controllers.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 603 of file page_parts.php.
{
try
{
$this->Trace->start_group( "controllers" );
foreach( $Packages as $i => $p )
{
if( $p[ 'settings' ]->get_setting( 'controller' , false ) )
{
if( method_exists( $p[ 'fetched_package' ] , 'controller' ) )
{
$this->run_single_controller( $p );
}
else
{
}
}
}
$this->Trace->end_group();
}
catch( Exception $e )
{
}
}
| compile_views |
( |
& |
$Packages, |
|
|
& |
$Template |
|
) |
| |
Function processes views.
- Parameters
-
| $Packages | - Packages. |
| $Template | - Template. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 708 of file page_parts.php.
{
try
{
$this->Trace->start_group( "views" );
foreach( $Packages as $i => $p )
{
if( $p[ 'placeholder' ] != '' )
{
if( $p[ 'settings' ]->get_setting( 'view' , false ) )
{
if( $p[ 'fetched_package' ] !== false && method_exists( $p[ 'fetched_package' ] , 'view' ) )
{
$this->run_single_view( $p , $Template );
}
else
{
}
}
}
}
$this->Trace->end_group();
}
catch( Exception $e )
{
}
}
| execute_generators |
( |
& |
$Packages, |
|
|
|
$Type, |
|
|
& |
$Template |
|
) |
| |
Function runs generators.
- Parameters
-
| $Packages | - Packages. |
| $Type | - Generator type. |
| $Template | - Template. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 517 of file page_parts.php.
{
try
{
$this->Trace->start_group( $Type );
$Changed = false;
$Template->add_stylesheets();
$counter = 0;
foreach( $Packages as $i => $p )
{
if( $p[ 'settings' ]->get_setting( $Type , false ) )
{
if( method_exists( $p[ 'fetched_package' ] , $Type ) )
{
$Caller = array( $p[ 'fetched_package' ] , $Type );
continue;
}
}
}
$this->Trace->end_group();
}
catch( Exception $e )
{
}
}
| fetch_packages |
( |
& |
$Packages, |
|
|
& |
$Template |
|
) |
| |
Function fetches packages for the generating page.
- Parameters
-
| $Packages | - Packages. |
| $Template | - Template. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 466 of file page_parts.php.
{
try
{
foreach( $Packages as $i => $p )
{
if( $Packages[ $i ][ 'settings' ]->get_setting( 'meta' , false ) !== false )
{
$MetaFileName = $Packages[ $i ][ 'settings' ]->get_setting( 'meta' );
$MetaSettings = $this->CachedMultyFS->file_get_contents( "$PackagePath/meta/$MetaFileName" );
$Packages[ $i ][ 'settings' ]->append_settings( $MetaSettings );
}
$this->get_package_for_description( $Packages[ $i ] );
}
}
catch( Exception $e )
{
}
}
| get_controller |
( |
|
$PackageName, |
|
|
|
$PackageVersion |
|
) |
| |
Function returns controller.
- Parameters
-
| $PackageName | - package name. |
| $PackageVersion | - package version. |
- Returns
- controller object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 184 of file page_parts.php.
{
try
{
$Package =
get_package( $PackageName , $PackageVersion , __FILE__ );
if( $Package === false )
{
$PackageName , $PackageVersion ).'/unexisting_controller.php'
);
}
return( $Package );
}
catch( Exception $e )
{
}
}
| get_package_appliance |
( |
|
$Page, |
|
|
|
$PageName, |
|
|
|
$PageOptions |
|
) |
| |
Function returns list of packages.
- Parameters
-
| $Page | - Object of the page::page_access class. |
| $PageName | - Name of the composing page. |
| $PageOptions | - Generation options. |
- Returns
- HTML code of the composed page.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 340 of file page_parts.php.
{
try
{
$PagePackages = $Page->get_package_appliance( $PageName );
$PredefinedPackages = $this->get_predefined_packages( $PageOptions );
return( array_merge( $PredefinedPackages , $PagePackages ) );
}
catch( Exception $e )
{
}
}
| get_settings_for_package |
( |
|
$PackageName, |
|
|
|
$PackageVersion |
|
) |
| |
Getting global settings of the package.
- Parameters
-
| $PackageName | - Package name. |
| $PackageVersion | - Package version. |
- Returns
- string with settings.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 137 of file page_parts.php.
{
try
{
if( $this->CachedMultyFS->file_exists( "$PackageDirectory/conf/cf_global_settings" ) )
{
return( $this->CachedMultyFS->file_get_contents( "$PackageDirectory/conf/cf_global_settings" ) );
}
else
{
return( '' );
}
}
catch( Exception $e )
{
}
}
| get_view |
( |
|
$PackageName, |
|
|
|
$PackageVersion |
|
) |
| |
Function returns view.
- Parameters
-
| $PackageName | - package name. |
| $PackageVersion | - package version. |
- Returns
- view object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 232 of file page_parts.php.
{
try
{
$Package =
get_package( $PackageName , $PackageVersion , __FILE__ );
if( $Package === false )
{
$Package->set_path(
);
}
return( $Package );
}
catch( Exception $e )
{
}
}
| load_settings_for_package |
( |
& |
$Package, |
|
|
& |
$Template |
|
) |
| |
Function loads package's settings.
- Parameters
-
| $Package | - Package. |
| $Template | - Template. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 377 of file page_parts.php.
{
try
{
$Package[ 'package' ] , $Package[ 'package_version' ]
);
$Package[ 'settings' ]->load_settings( $GlobalSettings );
$Package[ 'settings' ]->append_settings( $Package[ 'options' ] );
$PlaceHolderParameters = $Template->get_placeholder_parameters( $Package[ 'placeholder' ] );
if( $PlaceHolderParameters !== false )
{
$Package[ 'settings' ]->append_settings( $PlaceHolderParameters );
}
}
catch( Exception $e )
{
}
}
| throw_method_was_not_found_exception |
( |
|
$p, |
|
|
|
$FunctionName |
|
) |
| |
Function throws exception that method was not found.
- Parameters
-
| $p | - Package data. |
| $FunctionName | - Function name. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 97 of file page_parts.php.
{
$ClassName = $p[ 'fetched_package' ] !== false ? get_class( $p[ 'fetched_package' ] ) : 'false';
$PackageFullName = $p[ 'package' ].'.'.$p[ 'package_version' ];
throw(
new Exception(
'Function "'.$FunctionName.'" was not found in class "'.$ClassName.
'" from package '.$PackageFullName
)
);
}
Field Documentation
| $PageMarkupUtilities = false |
The documentation for this class was generated from the following file: