ultimix
settings_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_db_setting (&$Manifest)
 get_package_setting (&$Manifest)
 get_setting (&$Manifest)
 compile_input_setting ($SettingName, $SettingValue, $Label)
 compile_checkbox_setting ($SettingName, $SettingValue, $Label)
 compile_textarea_setting ($SettingName, $SettingValue, $Label)
 compile_config_line ($ConfigLine)
 settings_form ($Options)
 view ($Options)
 compile_settings (&$Settings)
 compile_db_settings (&$Settings)

Data Fields

 $CachedMultyFS = false
 $DBSettings = false
 $PackageSettings = false
 $PageComposerUtilities = false
 $Security = false
 $Settings = false
 $String = false
 $Output = false

Detailed Description

Component's view.

Author
Dodonov A.A.

Definition at line 26 of file settings_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 68 of file settings_view.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->DBSettings = get_package( 'settings::db_settings' , 'last' , __FILE__ );
$this->PackageSettings = get_package( 'settings::package_settings' , 'last' , __FILE__ );
$this->PageComposerUtilities = get_package( 'page::page_composer_utilities' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->Settings = get_package_object( 'settings::settings' , '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_checkbox_setting (   $SettingName,
  $SettingValue,
  $Label 
)

Function compiles form line.

Parameters
$SettingName- Setting name.
$SettingValue- Setting value.
$Label- Label.
Returns
HTML code.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 294 of file settings_view.php.

{
try
{
$Template = $this->CachedMultyFS->get_template( __FILE__ , 'checkbox_setting.tpl' );
$PlaceHolders = array( '{name}' , '{value}' , '{label}' );
$Data = array( $SettingName , intval( $SettingValue ) ? 'checked' : '' , $Label );
$Template = str_replace( $PlaceHolders , $Data , $Template );
return( $Template );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_config_line (   $ConfigLine)

Function processes config line.

Parameters
$ConfigLine- Config's line.
Returns
HTML code.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 437 of file settings_view.php.

{
try
{
$this->Settings->load_settings( $ConfigLine );
list( $SettingName , $SettingValue , $Label ) = $this->get_setting( $this->Settings );
return( $this->compile_controllers( $SettingName , $SettingValue , $Label ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_db_settings ( $Settings)

Function processes macro 'db_settings'.

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

Definition at line 639 of file settings_view.php.

{
try
{
$SettingName = $Settings->get_setting( 'name' );
$DefaultValue = $Settings->get_setting( 'default' , '' );
return( $this->DBSettings->get_setting( $SettingName , $DefaultValue ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_input_setting (   $SettingName,
  $SettingValue,
  $Label 
)

Function compiles form line.

Parameters
$SettingName- Setting name.
$SettingValue- Setting value.
$Label- Label.
Returns
HTML code.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 245 of file settings_view.php.

{
try
{
$Template = $this->CachedMultyFS->get_template( __FILE__ , 'input_setting.tpl' );
$PlaceHolders = array( '{name}' , '{value}' , '{label}' );
$Data = array( $SettingName , $SettingValue , $Label );
$Template = str_replace( $PlaceHolders , $Data , $Template );
return( $Template );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_settings ( $Settings)

Function processes macro 'settings'.

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

Definition at line 598 of file settings_view.php.

{
try
{
return(
$this->PackageSettings->get_package_setting(
$Settings->get_setting( 'package_name' ) ,
$Settings->get_setting( 'package_version' , 'last' ) ,
$Settings->get_setting( 'config_file_name' ) ,
$Settings->get_setting( 'name' ) , $Settings->get_setting( 'default' , '' )
)
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_textarea_setting (   $SettingName,
  $SettingValue,
  $Label 
)

Function compiles form line.

Parameters
$SettingName- Setting name.
$SettingValue- Setting value.
$Label- Label.
Returns
HTML code.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 343 of file settings_view.php.

{
try
{
$Template = $this->CachedMultyFS->get_template( __FILE__ , 'textarea_setting.tpl' );
$PlaceHolders = array( '{name}' , '{value}' , '{label}' );
$Data = array( $SettingName , $SettingValue , $Label );
$Template = str_replace( $PlaceHolders , $Data , $Template );
return( $Template );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_db_setting ( $Manifest)

Function gets setting name and value for the config line.

Parameters
$Manifest- Loaded config.
Returns
array( setting_name , setting_value , label ).
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 108 of file settings_view.php.

{
try
{
$SettingName = $Manifest->get_setting( 'setting_name' );
$DefaultValue = $Manifest->get_setting( 'default_value' , '' );
$SettingValue = $this->DBSettings->get_setting( $SettingName , $DefaultValue );
$SettingValue = $this->Security->get( $SettingValue , 'script' );
return( array( $SettingName , $SettingValue , $Manifest->get_setting( 'label' ) ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_package_setting ( $Manifest)

Function gets setting name and value for the config line.

Parameters
$Manifest- Loaded config.
Returns
array( setting_name , setting_value , label ).
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 149 of file settings_view.php.

{
try
{
$PackageName = $Manifest->get_setting( 'package_name' );
$PackageVersion = $Manifest->get_setting( 'package_version' , 'last' );
list( $ConfigFileName , $SettingName ) = $Manifest->get_settings( 'config_file_name,setting_name' );
$DefaultValue = $Manifest->get_setting( 'default_value' , '' );
$SettingValue = $this->PackageSettings->get_package_setting(
$PackageName , $PackageVersion , $ConfigFileName , $SettingName , $DefaultValue
);
$SettingValue = $this->Security->get( $SettingValue , 'script' );
return( array( $SettingName , $SettingValue , $Manifest->get_setting( 'label' ) ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_setting ( $Manifest)

Function gets setting name and value for the config line.

Parameters
$Manifest- Loaded config.
Returns
array( setting_name , setting_value , label ).
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 194 of file settings_view.php.

{
try
{
$PackageName = $Manifest->get_setting( 'package_name' , false );
if( $PackageName === false )
{
return( $this->get_db_setting( $Manifest ) );
}
else
{
return( $this->get_package_setting( $Manifest ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
settings_form (   $Options)

Function draws tab control with settings.

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

Definition at line 514 of file settings_view.php.

{
try
{
$FormName = $Options->get_setting( 'form_name' );
$ConfigPath = dirname( __FILE__ )."/conf/cf_$FormName";
if( $this->CachedMultyFS->file_exists( $ConfigPath ) )
{
$this->compile_settings_form( $FormName , $ConfigPath );
}
else
{
$this->Output = '{lang:tab_manifest_was_not_found}';
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Component's view.

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

Definition at line 558 of file settings_view.php.

{
try
{
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_settings_form' );
if( $ContextSet->execute( $Options , $this ) )return( $this->Output );
return( '' );
}
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 settings_view.php.

$DBSettings = false

Definition at line 39 of file settings_view.php.

$Output = false

Display method's result.

Author
Dodonov A.A.

Definition at line 56 of file settings_view.php.

$PackageSettings = false

Definition at line 40 of file settings_view.php.

$PageComposerUtilities = false

Definition at line 41 of file settings_view.php.

$Security = false

Definition at line 42 of file settings_view.php.

$Settings = false

Definition at line 43 of file settings_view.php.

$String = false

Definition at line 44 of file settings_view.php.


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