ultimix
system_structure_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_root_item ($Items)
 get_prev_item ($MainItem, $Items)
 get_item ($Page, $Items)
 compile_map_items ($Map, $RootItem, $Items)
 compile_map ($RootItem, $Items)
 draw_map ($Options)
 draw_bread_crumbs (&$Options)
 view (&$Options)

Data Fields

 $Output
 $Cache = false
 $CachedMultyFS = false
 $Security = false
 $Settings = false
 $PageAccess = false
 $String = false

Detailed Description

This class provides component visualisation routine.

Author
Dodonov A.A.

Definition at line 26 of file system_structure_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 67 of file system_structure_view.php.

{
try
{
$this->Cache = get_package( 'cache' , 'last' , __FILE__ );
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->Settings = get_package( 'settings::package_settings' , 'last' , __FILE__ );
$this->PageAccess = get_package( 'page::page_access' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_map (   $RootItem,
  $Items 
)

Function compiles map.

Parameters
$RootItem- Root item.
$Items- Map items.
Returns
Map.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 305 of file system_structure_view.php.

{
try
{
$Map = '';
$PageDescription = $this->PageAccess->get_page_description( $RootItem->page );
$Map .= $this->CachedMultyFS->get_template( __FILE__ , 'map_item_start.tpl' ).
( strlen( $RootItem->navigation ) ? $RootItem->navigation :
'{href:tpl=std;page=./'.$RootItem->page.'.html;raw_text='.$PageDescription[ 'title' ].'}' );
$Map .= $this->compile_map_items( $Map , $RootItem , $Items );
$Map .= $this->CachedMultyFS->get_template( __FILE__ , 'map_item_end.tpl' );
return( $Map );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_map_items (   $Map,
  $RootItem,
  $Items 
)

Function compiles single level of the map.

Parameters
$Map- Map's part.
$RootItem- Root item.
$Items- Map items.
Returns
Map.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 248 of file system_structure_view.php.

{
try
{
$MapPart = '';
foreach( $Items as $i )
{
if( $i->root_page == $RootItem->page && $i->root_page != $i->page )
{
if( $MapPart === '' )
{
$MapPart .= $this->CachedMultyFS->get_template( __FILE__ , 'map_start.tpl' );
}
$MapPart .= $this->compile_map( $i , $Items );
}
}
if( $MapPart !== '' )
{
$MapPart .= $this->CachedMultyFS->get_template( __FILE__ , 'map_end.tpl' );
}
return( $MapPart );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
draw_bread_crumbs ( $Options)

Function draws "bread crumbs".

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

Definition at line 600 of file system_structure_view.php.

{
try
{
$PageName = $this->Security->get_g( 'page_name' , 'command' );
$Data = $this->Cache->get_data( "bread_crumbs_for_$PageName" );
if( $Data === false )
{
$Str = $this->compile_bread_crumbs( $Options );
$this->Cache->add_data( "bread_crumbs_for_$PageName" , $Str );
$this->Output = $Str;
}
else
{
$this->Output = $Data;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
draw_map (   $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 351 of file system_structure_view.php.

{
try
{
$Data = $this->Cache->get_data( 'full_map' );
if( $Data === false )
{
$Access = get_package( 'system_structure::system_structure_access' , 'last' , __FILE__ );
$Items = $Access->unsafe_select();
$RootItem = $this->get_root_item( $Items );
$Map = $this->CachedMultyFS->get_template( __FILE__ , 'map_start.tpl' );
$Map .= $this->compile_map( $RootItem , $Items );
$Map .= $this->CachedMultyFS->get_template( __FILE__ , 'map_end.tpl' );
$this->Cache->add_data( 'full_map' , $Map );
$this->Output = $Map;
}
else
{
$this->Output = $Data;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_item (   $Page,
  $Items 
)

Function returns item.

Parameters
$Page- Page.
$Items- Map items.
Returns
Item.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 198 of file system_structure_view.php.

{
try
{
foreach( $Items as $i => $v )
{
if( $v->page == $Page )
{
return( $v );
}
}
return( false );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_prev_item (   $MainItem,
  $Items 
)

Function returns root item.

Parameters
$MainItem- Item.
$Items- Map items.
Returns
Root item.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 152 of file system_structure_view.php.

{
try
{
foreach( $Items as $i => $v )
{
if( $v->page == $MainItem->root_page )
{
return( $v );
}
}
return( false );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_root_item (   $Items)

Function returns root of the map.

Parameters
$Items- Map items.
Returns
Root item or false.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 106 of file system_structure_view.php.

{
try
{
foreach( $Items as $i => $v )
{
if( $v->page == $v->root_page )
{
return( $v );
}
}
return( false );
}
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 648 of file system_structure_view.php.

{
try
{
$ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_map' );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_bread_crumbs' );
$ContextSet->execute( $Options , $this , __FILE__ );
return( $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Cache = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file system_structure_view.php.

$CachedMultyFS = false

Definition at line 51 of file system_structure_view.php.

$Output

Display function's result.

Author
Dodonov A.A.

Definition at line 38 of file system_structure_view.php.

$PageAccess = false

Definition at line 54 of file system_structure_view.php.

$Security = false

Definition at line 52 of file system_structure_view.php.

$Settings = false

Definition at line 53 of file system_structure_view.php.

$String = false

Definition at line 55 of file system_structure_view.php.


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