ultimix
common_buttons_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_common_button_content (&$CommonStateConfig, &$ExtOptions, $Name)
 get_config (&$ContextSetConfig, &$Options, $Name)
 compile_search_button (&$ContextSetConfig, &$Options, $Code)
 compile_create_button (&$ContextSetConfig, &$Options, $Code)
 compile_update_button (&$ContextSetConfig, &$Options, $Code)
 compile_copy_button (&$ContextSetConfig, &$Options, $Code)
 compile_delete_button (&$ContextSetConfig, &$Options, $Code)
 compile_buttons (&$ContextSetConfig, &$Options, $Str)

Data Fields

 $CachedMultyFS = false
 $ContextSetConfigs = false
 $PermitAlgorithms = false
 $Settings = false
 $Trace = false
 $Version = 1

Detailed Description

Class for rapid buttons creation.

Author
Dodonov A.A.

Definition at line 26 of file common_buttons.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 70 of file common_buttons.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$PackageName = 'gui::context_set::context_set_configs';
$this->ContextSetConfigs = get_package( $PackageName , 'last' , __FILE__ );
$this->PermitAlgorithms = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$this->Settings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->Trace = get_package( 'trace' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_buttons ( $ContextSetConfig,
$Options,
  $Str 
)

Method creates buttons.

Parameters
$ContextSetConfig- Options of context_set.
$Options- Options of drawing.
$Str- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 531 of file common_buttons.php.

{
try
{
$this->Trace->start_group( 'compile_buttons' );
$Str = $this->compile_search_button( $ContextSetConfig , $Options , $Str );
$Str = $this->compile_create_button( $ContextSetConfig , $Options , $Str );
$Str = $this->compile_update_button( $ContextSetConfig , $Options , $Str );
$Str = $this->compile_copy_button( $ContextSetConfig , $Options , $Str );
$Str = $this->compile_delete_button( $ContextSetConfig , $Options , $Str );
$this->Trace->end_group();
$Str = str_replace( '{prefix}' , $ContextSetConfig->get_setting( 'prefix' , '' ) , $Str );
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_copy_button ( $ContextSetConfig,
$Options,
  $Code 
)

Function processes macro 'copy_button' in a string.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Code- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 433 of file common_buttons.php.

{
try
{
if( strpos( $Code , chr( 123 ).'copy_button' ) === false )
{
return( $Code );
}
$Config = $this->get_config( $ContextSetConfig , $Options , 'copy_form' );
return( $this->compile_button( $Config , $Code , 'copy' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_create_button ( $ContextSetConfig,
$Options,
  $Code 
)

Function processes string.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Code- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 335 of file common_buttons.php.

{
try
{
if( strpos( $Code , chr( 123 ).'create_button' ) === false )
{
return( $Code );
}
$Config = $this->get_config( $ContextSetConfig , $Options , 'create_form' );
return( $this->compile_button( $Config , $Code , 'create' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_delete_button ( $ContextSetConfig,
$Options,
  $Code 
)

Function processes string.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Code- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 482 of file common_buttons.php.

{
try
{
if( strpos( $Code , chr( 123 ).'delete_button' ) === false )
{
return( $Code );
}
$Config = $this->get_config( $ContextSetConfig , $Options , 'delete_button' );
return( $this->compile_button( $Config , $Code , 'delete' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_search_button ( $ContextSetConfig,
$Options,
  $Code 
)

Function processes string.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Code- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 223 of file common_buttons.php.

{
try
{
if( strpos( $Code , chr( 123 ).'search_button' ) === false )
{
return( $Code );
}
$Config = $this->get_config( $ContextSetConfig , $Options , 'search_form' );
$ExtOptions = false;
$Code = str_replace(
'{search_button}' ,
$this->get_common_button_content( $Config , $ExtOptions , 'search' ) , $Code
);
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_update_button ( $ContextSetConfig,
$Options,
  $Code 
)

Function processes string.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Code- Processing string.
Returns
HTML code to display.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 384 of file common_buttons.php.

{
try
{
if( strpos( $Code , chr( 123 ).'update_button' ) === false )
{
return( $Code );
}
$Config = $this->get_config( $ContextSetConfig , $Options , 'update_form' );
return( $this->compile_button( $Config , $Code , 'update' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_common_button_content ( $CommonStateConfig,
$ExtOptions,
  $Name 
)

Function returns code of the create button.

Parameters
$CommonStateConfig- State's config.
$ExtOptions- Additional settings.
$Name- Button name.
Returns
HTML code to display.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 118 of file common_buttons.php.

{
try
{
$PermitsFilter = $CommonStateConfig->get_setting( 'permits_filter' , 'admin' );
$ValidatingPermits = $CommonStateConfig->get_setting( 'permits_validation' , $PermitsFilter );
$PermitValidationResult = $this->PermitAlgorithms->object_has_all_permits(
false , 'user' , $ValidatingPermits
);
if( $PermitValidationResult )
{
$Path = _get_package_relative_path_ex( 'gui::context_set::common_buttons' , 'last' );
$ButtonCode = $this->CachedMultyFS->get_template( __FILE__ , 'toolbar_'.$Name.'_button.tpl' );
return( $ButtonCode );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_config ( $ContextSetConfig,
$Options,
  $Name 
)

Fetching config.

Parameters
$ContextSetConfig- Set of contexts settings.
$Options- Options of drawing.
$Name- State name.
Returns
Config content.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 176 of file common_buttons.php.

{
try
{
$Config = $this->ContextSetConfigs->load_common_state_config(
$ContextSetConfig , 'common_state_config_'.$Name , 'cfcxs_'.$Name ,
$Options->get_setting( 'file_path' )
);
return( $Config );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file common_buttons.php.

$ContextSetConfigs = false

Definition at line 39 of file common_buttons.php.

$PermitAlgorithms = false

Definition at line 40 of file common_buttons.php.

$Settings = false

Definition at line 41 of file common_buttons.php.

$Trace = false

Definition at line 42 of file common_buttons.php.

$Version = 1

Version.

Author
Dodonov A.A.

Definition at line 54 of file common_buttons.php.


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