57 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
58 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
59 $this->String =
get_package(
'string' ,
'last' , __FILE__ );
97 private function get_single_radiobutton( $r , $Name , $CurrentValue )
101 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'radio_set_item.tpl' );
103 $PlaceHolders = array(
'{name}' ,
'{value}' ,
'{current_value}' ,
'{label}' );
105 $Data = array( $Name , $r->Value , $CurrentValue , $r->label );
107 return( str_replace( $PlaceHolders , $Data , $Code ) );
109 catch( Exception $e )
154 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'radio_set_start.tpl' );
156 foreach( $Records as $r )
158 if( $Counter == $Cols )
161 $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'radio_set_line_end.tpl' );
164 $Code .= $this->get_single_radiobutton( $r , $Name , $CurrentValue );
169 return( $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'radio_set_end.tpl' ) );
171 catch( Exception $e )
199 private function get_records( &$Settings )
203 $Query = $Settings->get_setting(
'query' );
205 $Records = $this->Database->query( $Query );
206 $Records = $this->Database->fetch_results( $Records );
210 catch( Exception $e )
242 list( $Cols , $Name )= $Settings->get_setting(
'cols,name' );
244 $CurrentValue = $this->Security->get_gp( $Name ,
'command' ,
'' );
246 $Records = $this->get_records( $Settings );
252 catch( Exception $e )
284 $Value = $Settings->get_setting(
'value' );
285 $Name = $Settings->get_setting(
'name' );
287 if( $this->Security->get_gp( $Name ) )
289 $CurrentValue = $this->Security->get_gp( $Name ,
'string' );
293 $CurrentValue = $Settings->get_setting(
'default' , $Value );
296 $Checked = $Value === $CurrentValue ? $Checked =
'checked' :
'';
300 catch( Exception $e )
332 $Name = $Settings->get_setting(
'name' );
334 $Value = $Settings->get_setting(
'value' );
338 $id = $Settings->get_setting(
'id' , md5( microtime() ) );
340 $Template =
"<input id=\"$id\" style=\"cursor: pointer;\" ".
341 "type=\"radio\" value=\"$Value\" $Checked name=\"$Name\">";
343 $Label = $Settings->get_setting(
'label' ,
'' );
347 $Template =
"<label for=\"$id\" style=\"cursor: pointer;\">$Template {lang:$Label}</label>";
352 catch( Exception $e )
384 $Settings->set_undefined(
'current_value' , 1 );
386 $Name = $Settings->get_setting(
'name' );
387 $CurrentValue = $Settings->get_setting(
'current_value' );
389 $Code =
"{radio:value=1;current_value=$CurrentValue;name=$Name;label=yes} ".
390 "{radio:value=2;current_value=$CurrentValue;name=$Name;label=no}";
394 catch( Exception $e )