ultimix
permit_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_permit (&$Settings, $Data)
 compile_no_permit (&$Settings, $Data)
 compile_permit_list (&$Settings)
 compile_permit_list_for_object (&$Settings)
 compile_permit_list_widget (&$Settings)
 compile_permit_select (&$Settings)

Data Fields

 $Permits = array()
 $CachedMultyFS = false
 $PermitAccess = false
 $PermitAlgorithms = false
 $UserAlgorithms = false
 $ControllerWasAdded = false

Detailed Description

Class provides macro processing.

Author
Dodonov A.A.

Definition at line 26 of file permit_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 115 of file permit_markup.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->PermitAlgorithms = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$this->UserAlgorithms = get_package( 'user::user_algorithms' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_no_permit ( $Settings,
  $Data 
)

Function compiles macro 'no_permit'.

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

Definition at line 243 of file permit_markup.php.

{
try
{
$Flag = $this->has_premits( $Settings , $Data );
if( $Flag )
{
return( '' );
}
else
{
return( $Data );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_permit ( $Settings,
  $Data 
)

Function compiles macro 'permit'.

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

Definition at line 196 of file permit_markup.php.

{
try
{
$Flag = $this->has_premits( $Settings , $Data );
if( $Flag )
{
return( $Data );
}
else
{
return( '' );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_permit_list ( $Settings)

Function compiles macro 'permit_list'.

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

Definition at line 286 of file permit_markup.php.

{
try
{
$this->Database->query_as( DB_OBJECT );
$Items = $this->Database->select( 'permit' , 'umx_permit' , '1 = 1' );
$c = count( $Items );
$AllPermits = '';
foreach( $Items as $k => $i )
{
$AllPermits .= $i->permit;
if( $k + 1 != $c )
{
$AllPermits .= ', ';
}
}
return( $AllPermits );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_permit_list_for_object ( $Settings)

Function compiles macro 'permit_list_for_object'.

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

Definition at line 333 of file permit_markup.php.

{
try
{
$PermitList = '';
list( $Object , $Type ) = $Settings->get_settings( 'object,type' , 'public,' );
$PermitList = $this->PermitAlgorithms->get_permits_for_object( $Object , $Type , false );
sort( $PermitList );
$PermitList = implode( ', ' , $PermitList );
return( $PermitList );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_permit_list_widget ( $Settings)

Function compiles macro 'permit_list_widget'.

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

Definition at line 522 of file permit_markup.php.

{
try
{
list( $ObjectPermitList , $AllPermitList ) = $this->get_permits( $Settings );
$PermitListWidget = $this->CachedMultyFS->get_template( __FILE__ , 'permit_list.tpl' );
$Object = $Settings->get_setting( 'object' );
$PermitListWidget = str_replace( '{object}' , $Object , $PermitListWidget );
$PermitListWidget = $this->compile_object_permits( $ObjectPermitList , $PermitListWidget );
return( $this->compile_all_permits( $AllPermitList , $ObjectPermitList , $PermitListWidget ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_permit_select ( $Settings)

Function compiles macro 'permit_select'.

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

Definition at line 564 of file permit_markup.php.

{
try
{
list( $Name , $Class ) = $Settings->get_settings( 'name,class', 'permit,flat width_160' );
$Code = "{select:name=$Name;class=$Class;".
"query=SELECT id , title AS value FROM `umx_permit` ORDER BY title}";
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file permit_markup.php.

$ControllerWasAdded = false

Was the controller added.

Author
Dodonov A.A.

Definition at line 65 of file permit_markup.php.

$PermitAccess = false

Definition at line 51 of file permit_markup.php.

$PermitAlgorithms = false

Definition at line 52 of file permit_markup.php.

$Permits = array()

Object permits.

Author
Dodonov A.A.

Definition at line 38 of file permit_markup.php.

$UserAlgorithms = false

Definition at line 53 of file permit_markup.php.


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