ultimix
menu_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 show_menu ($Options)
 view ($Options)

Data Fields

 $Cache = false
 $CachedMultyFS = false
 $Database = false
 $DatabaseAlgorithms = false
 $MenuAccess = false
 $Security = false
 $Output = false

Detailed Description

Menu class.

Author
Dodonov A.A.

Definition at line 26 of file menu_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 59 of file menu_view.php.

{
try
{
$this->Cache = get_package( 'cache' , 'last' , __FILE__ );
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->DatabaseAlgorithms = get_package( 'database::database_algorithms' , 'last' , __FILE__ );
$this->MenuAccess = get_package( 'menu::menu_access' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

show_menu (   $Options)

Function displays menu.

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

Definition at line 106 of file menu_view.php.

{
try
{
$MenuName = $Options->get_setting( 'menu_name' );
$DataName = "menu_$MenuName";
$this->Output = $this->Cache->get_data( $DataName );
if( $this->Output === false )
{
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'menu_header.tpl' );
$Result = $this->MenuAccess->get_menu_items( $MenuName );
foreach( $Result as $r )
{
$this->Output .= get_field( $r , 'href' );
}
$this->Output .= $this->CachedMultyFS->get_template( __FILE__ , 'menu_footer.tpl' );
$this->Cache->add_data( $DataName , $this->Output );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Function draws menu.

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

Definition at line 150 of file menu_view.php.

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

Field Documentation

$Cache = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file menu_view.php.

$CachedMultyFS = false

Definition at line 39 of file menu_view.php.

$Database = false

Definition at line 40 of file menu_view.php.

$DatabaseAlgorithms = false

Definition at line 41 of file menu_view.php.

$MenuAccess = false

Definition at line 42 of file menu_view.php.

$Output = false

View result.

Author
Dodonov A.A.

Definition at line 86 of file menu_view.php.

$Security = false

Definition at line 43 of file menu_view.php.


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