ultimix
lang_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 set_locale_form ($Options)
 view (&$Options)

Data Fields

 $CachedMultyFS = false
 $Lang = false
 $Output

Detailed Description

Class provides language dependent substitutions for strings.

Author
Dodonov A.A.

Definition at line 26 of file lang_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 55 of file lang_view.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Lang = get_package( 'lang' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

set_locale_form (   $Options)

Function draws change language fom.

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

Definition at line 98 of file lang_view.php.

{
try
{
$LangList = $this->Lang->get_list_of_languages();
$Form = $this->CachedMultyFS->get_template( __FILE__ , 'lang_form.tpl' );
$this->Output = $Form;
foreach( $LangList as $Lang )
{
$LangFlag = $Lang === $this->Lang->get_locale() ? 'active' : 'inactive';
$Template = $this->CachedMultyFS->get_template( __FILE__ , $LangFlag.'_lang.tpl' );
$Template = str_replace( '{client_lang}' , $Lang , $Template );
$this->Output = str_replace( '{lang_list}' , "$Template{lang_list}" , $this->Output );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view ( $Options)

Component's view.

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

Definition at line 141 of file lang_view.php.

{
try
{
if( $Options->get_setting( 'lang_file' , false ) )
{
$ComponentHTML = '{lang_file:'.$Options->get_all_settings().'}';
$Changed = false;
$ComponentHTML = $this->LangMarkup->compile_lang_file( $Options );
return( '' );
}
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_set_locale_form' );
if( $ContextSet->execute( $Options , $this ) )return( $this->Output );
}
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 lang_view.php.

$Lang = false

Definition at line 39 of file lang_view.php.

$Output

HTML code of the component.

Author
Dodonov A.A.

Definition at line 78 of file lang_view.php.


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