ultimix
dialog_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 pre_generation (&$Options)
 compile_select_dialog_content (&$Settings)
 compile_select_dialog (&$Settings)
 compile_view_dialog (&$Settings)
 compile_static_dialog (&$BlockSettings)
 compile_iframe_dialog (&$Settings)
 compile_opener (&$Settings)
 prepare_data_for_dialog (&$BlockSettings)
 compile_dialog (&$BlockSettings)
 compile_add_opener (&$BlockSettings)

Data Fields

 $CachedMultyFS = false
 $PageJS = false
 $String = false
 $Utilities = false
 $Dialogs = array()

Detailed Description

Class processes dialog macroes.

Author
Dodonov A.A.

Definition at line 26 of file dialog_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 69 of file dialog_markup.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->Utilities = get_package( 'utilities' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_add_opener ( $BlockSettings)

Function compiles macro 'add_opener'.

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

Definition at line 678 of file dialog_markup.php.

{
try
{
$this->prepare_data_for_opener( $BlockSettings );
$AddOpenerScript = $this->CachedMultyFS->get_template( __FILE__ , 'add_opener.tpl' );
$Data = $BlockSettings->get_raw_settings();
$AddOpenerScript = $this->String->print_record( $AddOpenerScript , $Data );
return( $AddOpenerScript );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_dialog ( $BlockSettings)

Function compiles macro 'dialog'.

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

Definition at line 598 of file dialog_markup.php.

{
try
{
$this->prepare_data_for_dialog( $BlockSettings );
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'dialog_init.tpl' );
$Data = $BlockSettings->get_raw_settings();
$Code = $this->String->print_record( $Code , $Data );
$Code = $this->append_add_opener_if_necessary( $Code , $BlockSettings );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_iframe_dialog ( $Settings)

Function compiles macro 'iframe_dialog'.

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

Definition at line 398 of file dialog_markup.php.

{
try
{
$id = $Settings->get_setting( 'id' , md5( microtime( true ) ) );
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'iframe_dialog.tpl' );
$PlaceHolders = array( '{id}' , '{href}' , '{all_settings}' );
$Data = array( $id , $Settings->get_setting( 'href' ) , $Settings->get_all_settings() );
$Code = str_replace( $PlaceHolders , $Data , $Code );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_opener ( $Settings)

Function compiles opener.

Parameters
$Settings- Settings.
Returns
Code of the opener.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 439 of file dialog_markup.php.

{
try
{
list( $Selector , $Opener )= $Settings->get_settings( 'selector,opener' );
$DataSource = $Settings->get_setting( 'data_source' , $Selector );
$DataAcceptor = $Settings->get_setting( 'data_acceptor' , '' );
$StatusAcceptor = $Settings->get_setting( 'status_acceptor' , '' );
$Validation = $Settings->get_setting( 'before_open_validation' , 'nop' );
return(
"{add_opener:data_source=$DataSource;data_acceptor=$DataAcceptor;status_acceptor=$StatusAcceptor;".
"before_open_validation=$Validation;opener=$Opener;selector=$Selector}"
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_select_dialog ( $Settings)

Function compiles macro 'select_dialog'.

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

Definition at line 270 of file dialog_markup.php.

{
try
{
$DataSource = $Settings->get_setting( 'data_source' , md5( rand().microtime( true ) ) );
$Settings->set_setting( 'data_source' , $DataSource );
$id = $Settings->get_setting( 'id' , md5( microtime( true ) ) );
$Settings->set_setting( 'id' , $id );
$Code = '{select_dialog_content:'.$Settings->get_all_settings().
'}{dialog:selector=#'.$id.';'.$Settings->get_all_settings().
';cancel=true;ok_processor=ultimix.ExtractSimpleSelectResult}';
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_select_dialog_content ( $Settings)

Preparing dialog script.

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

Definition at line 226 of file dialog_markup.php.

{
try
{
$id = $Settings->get_setting( 'id' , md5( microtime( true ) ) );
$Type = $Settings->get_setting( 'type' , 'simple' );
$Script = $Type == 'simple' ?
$this->CachedMultyFS->get_template( __FILE__ , 'simple_select_dialog.tpl' ) : '';
$Script = str_replace( '{id}' , $id , $Script );
$SimpleRecords = $this->select_dialog_content( $ettings );
$Script = str_replace( '{records}' , $SimpleRecords , $Script );
return( $Script );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_static_dialog ( $BlockSettings)

Function compiles macro 'static_dialog'.

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

Definition at line 359 of file dialog_markup.php.

{
try
{
$id = $BlockSettings->get_setting( 'id' , md5( microtime( true ) ) );
$Script = $this->CachedMultyFS->get_template( __FILE__ , 'static_dialog.tpl' );
$Script = str_replace( '{id}' , $id , $Script );
$Script = str_replace( '{all_settings}' , $BlockSettings->get_all_settings() , $Script );
return( $Script );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_view_dialog ( $Settings)

Function compiles macro 'view_dialog'.

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

Definition at line 314 of file dialog_markup.php.

{
try
{
$id = $Settings->get_setting( 'id' , md5( microtime( true ) ) );
$Code = '';
if( isset( $this->Dialogs[ $id ] ) === false )
{
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'view_dialog.tpl' );
$Code = str_replace( '{id}' , $id , $Code );
$Code = str_replace( '{all_settings}' , $Settings->get_all_settings() , $Code );
$this->Dialogs[ $id ] = true;
}
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
pre_generation ( $Options)

Function executes before any page generating actions took place.

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

Definition at line 189 of file dialog_markup.php.

{
try
{
$Path = '{http_host}/'._get_package_relative_path_ex( 'jquery::dialog_markup' , 'last' );
$this->PageJS->add_javascript( "$Path/include/js/iframe.dialog.js" );
$this->PageJS->add_javascript( "$Path/include/js/jquery.dialog.js" );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
prepare_data_for_dialog ( $BlockSettings)

Function prepares data for dialog.

Parameters
$BlockSettings- Compilation parameters.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 557 of file dialog_markup.php.

{
try
{
$BlockSettings->get_setting( 'selector' );
$this->prepare_basic_settings( $BlockSettings );
$BlockSettings->set_undefined( 'hide_close_button' , 'false' );
$BlockSettings->set_undefined( 'ok_processor' , '' );
$BlockSettings->set_undefined( 'cancel' , 'false' );
$BlockSettings->set_undefined( 'on_open' , 'nop()' );
}
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 dialog_markup.php.

$Dialogs = array()

Cached info about created packages.

Author
Dodonov A.A.

Definition at line 53 of file dialog_markup.php.

$PageJS = false

Definition at line 39 of file dialog_markup.php.

$String = false

Definition at line 40 of file dialog_markup.php.

$Utilities = false

Definition at line 41 of file dialog_markup.php.


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