ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
radiobutton_markup_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| compile_radio_set_records ($Records, $Cols, $Name, $CurrentValue)
| compile_radio_set (&$Settings)
| get_checked (&$Settings)
| compile_radio (&$Settings)
| compile_yes_no (&$Settings)

## Data Fields
| $Database = false
| $Security = false
| $String = false

## Detailed Description

Class processes radio buttons macro.

Author
  Dodonov A.A.

Definition at line 26 of file radiobutton_markup.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Author
  Dodonov A.A.

Definition at line 53 of file radiobutton_markup.php.

{
try
{
$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_radio | ( | & | $Settings | ) |

Function processes macro 'radio'.

Parameters

  $Settings | - Compilation parameters.

Returns
  Control.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 328 of file radiobutton_markup.php.

{
try
{
$Name = $Settings->get_setting( 'name' );
$Value = $Settings->get_setting( 'value' );
$Checked = $this->get_checked( $Settings );
$id = $Settings->get_setting( 'id' , md5( microtime() ) );
$Template = "<input id=\"$id\" style=\"cursor: pointer;\" ".
"type=\"radio\" value=\"$Value\" $Checked name=\"$Name\">";
$Label = $Settings->get_setting( 'label' , '' );
if( $Label != '' )
{
$Template = "<label for=\"$id\" style=\"cursor: pointer;\">$Template {lang:$Label}</label>";
}
return( $Template );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_radio_set | ( | & | $Settings | ) |

Function processes macro 'radio'.

Parameters

  $Settings | - Compilation parameters.

Returns
  Control.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 238 of file radiobutton_markup.php.

{
try
{
list( $Cols , $Name )= $Settings->get_setting( 'cols,name' );
$CurrentValue = $this->Security->get_gp( $Name , 'command' , '' );
$Records = $this->get_records( $Settings );
$Code = $this->compile_radio_set_records( $Records , $Cols , $Name , $CurrentValue );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_radio_set_records | ( |  | $Records,
|  |  | $Cols,
|  |  | $Name,
|  |  | $CurrentValue
| ) |  |

Function compiles radio buttons.

Parameters

  $Records | - Records.
  $Cols | - Number of columns.
  $Name | - Control's name.
  $CurrentValue | - Current value.

Returns
  HTML code.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 149 of file radiobutton_markup.php.

{
try
{
$Counter = 0;
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'radio_set_start.tpl' );
foreach( $Records as $r )
{
if( $Counter == $Cols )
{
$Counter = 0;
$Code .= $this->CachedMultyFS->get_template( __FILE__ , 'radio_set_line_end.tpl' );
}
$Code .= $this->get_single_radiobutton( $r , $Name , $CurrentValue );
$Counter++;
}
return( $Code .= $this->CachedMultyFS->get_template( __FILE__ , 'radio_set_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_yes_no | ( | & | $Settings | ) |

Function compiles macro 'yes_no'.

Parameters

  $Settings | - Compilation parameters.

Returns
  HTML code.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 380 of file radiobutton_markup.php.

{
try
{
$Settings->set_undefined( 'current_value' , 1 );
$Name = $Settings->get_setting( 'name' );
$CurrentValue = $Settings->get_setting( 'current_value' );
$Code = "{radio:value=1;current_value=$CurrentValue;name=$Name;label=yes}&nbsp;".
"{radio:value=2;current_value=$CurrentValue;name=$Name;label=no}";
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_checked | ( | & | $Settings | ) |

Function returns 'checked' flag.

Parameters

  $Settings | - Settings.

Returns
  Flag.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 280 of file radiobutton_markup.php.

{
try
{
$Value = $Settings->get_setting( 'value' );
$Name = $Settings->get_setting( 'name' );
if( $this->Security->get_gp( $Name ) )
{
$CurrentValue = $this->Security->get_gp( $Name , 'string' );
}
else
{
$CurrentValue = $Settings->get_setting( 'default' , $Value );
}
$Checked = $Value === $CurrentValue ? $Checked = 'checked' : '';
return( $Checked );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$Database = false

Cached objects.

Author
  Dodonov A.A.

Definition at line 39 of file radiobutton_markup.php.

$Security = false

Definition at line 40 of file radiobutton_markup.php.

$String = false

Definition at line 41 of file radiobutton_markup.php.

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

- packages/gui/packages/radiobutton_markup/radiobutton_markup.php