ultimix
controls_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_textarea (&$Settings, $Data)
 get_select_data (&$Settings)
 compile_select (&$Settings)
 compile_year_list (&$Settings)

Data Fields

 $CachedMultyFS = false
 $Database = false
 $Security = false
 $String = false

Detailed Description

Class processes controls macro.

Author
Dodonov A.A.

Definition at line 26 of file controls_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 54 of file controls_markup.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , '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_select ( $Settings)

Function compiles macro 'select'.

Parameters
$Settings- Compilation parameters.
Returns
HTML код.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 278 of file controls_markup.php.

{
try
{
$Name = $Settings->get_setting( 'name' );
$Class = $Settings->get_setting( 'class' , 'width_320 flat' );
list( $First , $Second ) = $this->get_select_data( $Settings );
$SelectedId = $this->Security->get_gp(
$Name , 'string' , $Settings->get_setting( 'value' , false )
);
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'select_start.tpl' );
$Code = str_replace( array( '{name}' , '{class}' ) , array( $Name , $Class ) , $Code );
$Code .= $this->compile_select_options( $First , $Second , $SelectedId );
return( $Code.$this->CachedMultyFS->get_template( __FILE__ , 'select_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_textarea ( $Settings,
  $Data 
)

Function compiles macro 'textarea'.

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

Definition at line 127 of file controls_markup.php.

{
try
{
$Settings->set_setting( 'text' , $Data );
$this->prepare_textarea_settings( $Settings );
$SimpleEditor = $Settings->get_setting( 'simple_editor' , 0 );
$File = $SimpleEditor == 1 ? 'simple_editor.tpl' : 'editor.tpl';
$EditorTemplate = $this->CachedMultyFS->get_template( __FILE__ , $File );
$RawSettings = $Settings->get_raw_settings();
return( $this->String->print_record( $EditorTemplate , $RawSettings ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_year_list ( $Settings)

Function compiles macro 'year_list'.

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

Definition at line 326 of file controls_markup.php.

{
try
{
$From = $Settings->get_setting( 'from' , intval( date( 'Y' ) ) - 10 );
$To = $Settings->get_setting( 'to' , intval( date( 'Y' ) ) + 10 );
$First = array();
for( $i = $From ; $i <= $To ; $i++ )
{
$First [] = $i;
}
$First = implode( '|' , $First );
return( "{select:first=$First;second=$First;".$Settings->get_raw_settings()."}" );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_select_data ( $Settings)

Function fetches data for select.

Parameters
$Settings- Select settings.
Returns
array( ids , values ).
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 170 of file controls_markup.php.

{
try
{
if( $Settings->get_setting( 'query' , false ) !== false )
{
$Query = $Settings->get_setting( 'query' );
$this->Database->query_as( DB_OBJECT );
$Records = $this->Database->query( $Query );
$Records = $this->Database->fetch_results( $Records );
$First = get_field_ex( $Records , 'id' );
$Second = get_field_ex( $Records , 'value' );
}
else
{
$First = explode( '|' , $Settings->get_setting( 'first' , false ) );
$Second = explode( '|' , $Settings->get_setting( 'second' , false ) );
}
return( array( $First , $Second ) );
}
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 39 of file controls_markup.php.

$Database = false

Definition at line 40 of file controls_markup.php.

$Security = false

Definition at line 41 of file controls_markup.php.

$String = false

Definition at line 42 of file controls_markup.php.


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