ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
form_buttons_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| compile_create (&$Options, $Str)
| compile_save (&$Options, $Str)
| compile_copy (&$Options, $Str)
| compile_cancel (&$Options, $Str)
| compile_buttons (&$Settings, &$Options, $Str)

## Data Fields
| $Settings = false
| $String = false
| $Version = 1

## Detailed Description

Class for rapid buttons creation.

Author
  Dodonov A.A.

Definition at line 26 of file form_buttons.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 67 of file form_buttons.php.

{
try
{
$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_buttons | ( | & | $Settings,
|  | & | $Options,
|  |  | $Str
| ) |  |

Function creates form buttons.

Parameters

  $Settings | - Options of context_set.
  $Options | - Options of drawing.
  $Str | - processing string.

Returns
  HTML code to display.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 344 of file form_buttons.php.

{
try
{
$Str = $this->compile_create( $Options , $Str );
$Str = $this->compile_save( $Options , $Str );
$Str = $this->compile_copy( $Options , $Str );
$Str = $this->compile_cancel( $Options , $Str );
$Str = str_replace( '{prefix}' , $Settings->get_setting( 'prefix' , '' ) , $Str );
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_cancel | ( | & | $Options,
|  |  | $Str
| ) |  |

Function processes macro 'cancel'.

Parameters

  $Options | - Options of drawing.
  $Str | - String to process.

Returns
  HTML code to display.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 288 of file form_buttons.php.

{
try
{
if( strpos( $Str , '{cancel}' ) !== false )
{
$Str = str_replace( '{cancel}' , '{cancel:p=1}' , $Str );
}
for( ; $Parameters = $this->String->get_macro_parameters( $Str , 'cancel' ) ; )
{
$this->Settings->load_settings( $Parameters );
$Page = $this->get_cancel_page( $Options , $this->Settings );
$Str = str_replace( "{cancel:$Parameters}" , "{href:tpl=std;page=$Page;text=cancel}" , $Str );
}
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_copy | ( | & | $Options,
|  |  | $Str
| ) |  |

Function processes macro 'copy'.

Parameters

  $Options | - Options of drawing.
  $Str | - String to process.

Returns
  HTML code to display.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 201 of file form_buttons.php.

{
try
{
if( strpos( $Str , '{copy}' ) !== false )
{
$Str = str_replace( '{copy}' , '{href:tpl=submit0;form_id={prefix}_copy_form;text=save}' ,$Str );
}
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_create | ( | & | $Options,
|  |  | $Str
| ) |  |

Function processes macro 'create'.

Parameters

  $Options | - Options of drawing.
  $Str | - String to process.

Returns
  HTML code to display.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 106 of file form_buttons.php.

{
try
{
if( strpos( $Str , '{create}' ) !== false )
{
$Str = str_replace( '{create}' , '{create:text=create}' ,$Str );
}
for( ; $Parameters = $this->String->get_macro_parameters( $Str , 'create' ) ; )
{
$this->Settings->load_settings( $Parameters );
$Text = $this->Settings->get_setting( 'text' , 'create' );
$Code = "{href:tpl=submit0;form_id={prefix}_create_form;text=$Text}";
$Str = str_replace( "{create:$Parameters}" , $Code , $Str );
}
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_save | ( | & | $Options,
|  |  | $Str
| ) |  |

Function processes macro 'save'.

Parameters

  $Options | - Options of drawing.
  $Str | - String to process.

Returns
  HTML code to display.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 158 of file form_buttons.php.

{
try
{
if( strpos( $Str , '{save}' ) !== false )
{
$Str = str_replace( '{save}' , '{href:tpl=submit0;form_id={prefix}_update_form;text=save}' ,$Str );
}
return( $Str );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$Settings = false

Cached packages.

Author
  Dodonov A.A.

Definition at line 38 of file form_buttons.php.

$String = false

Definition at line 39 of file form_buttons.php.

$Version = 1

Version.

Author
  Dodonov A.A.

Definition at line 51 of file form_buttons.php.

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

- packages/gui/packages/context_set/packages/form_buttons/form_buttons.php