Detailed Description
Class processes radio buttons macro.
- Author
- Dodonov A.A.
Definition at line 26 of file radiobutton_markup.php.
Constructor & Destructor Documentation
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 )
{
}
}
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' );
$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 )
{
}
}
| 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 );
return( $Code );
}
catch( Exception $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 )
{
}
}
| 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} ".
"{radio:value=2;current_value=$CurrentValue;name=$Name;label=no}";
return( $Code );
}
catch( Exception $e )
{
}
}
| get_checked |
( |
& |
$Settings | ) |
|
Function returns 'checked' flag.
- Parameters
-
- 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 )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: