ultimix
json_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 fetch_data ($Options)
 view ($Options)

Data Fields

 $Output = false
 $Security = false
 $Settings = false
 $Utilities = false

Detailed Description

View provides access for json encoded data.

Author
Dodonov A.A.

Definition at line 26 of file json_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 64 of file json_view.php.

{
try
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->Settings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$this->Utilities = get_package_object( 'utilities' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

fetch_data (   $Options)

Function draws component.

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

Definition at line 142 of file json_view.php.

{
try
{
$FileName = $this->Security->get_gp( 'data' , 'command' , false );
if( $FileName === false )
{
return;
}
$this->Settings->load_file( dirname( __FILE__ )."/conf/cf_$FileName" );
$Provider = $this->Utilities->get_package( $this->Settings , __FILE__ , 'access_' );
$FunctionName = $this->Settings->get_setting( 'select_func' , 'select' );
$Records = $this->fetch_records( $Provider , $FunctionName );
$JSON = get_package( 'json' , 'last' , __FILE__ );
$this->Output = $JSON->encode( $Records );
}
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 component.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 193 of file json_view.php.

{
try
{
$this->fetch_data( $Options );
return( $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Output = false

Display function's result.

Author
Dodonov A.A.

Definition at line 38 of file json_view.php.

$Security = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file json_view.php.

$Settings = false

Definition at line 51 of file json_view.php.

$Utilities = false

Definition at line 52 of file json_view.php.


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