openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

component-radio-box.php (890B)


      1 <?php
      2 
      3 /**
      4  * 
      5  * @param unknown $name
      6  * @param unknown $values
      7  * @param unknown $value
      8  */
      9 function component_radio_box($name, $values, $value)
     10 {
     11 	foreach ($values as $box_key => $box_value)
     12 	{
     13 		if (is_array($box_value) && isset($box_value['lang']))
     14 		{
     15 			//$box_value = '<?php echo lang(\''.$box_value['lang'].'\') ? >';
     16 			$box_value = lang($box_value['lang']);
     17             $box_title = '';
     18 		}
     19 		elseif (is_array($box_value))
     20 		{
     21 			$box_key = $box_value['key'];
     22 			$box_title = $box_value['title'];
     23 			$box_value = $box_value['value'];
     24 		}
     25 		else
     26 		{
     27 			$box_title = '';
     28 		}
     29 		
     30 		$id = REQUEST_ID.'_'.$name.'_'.$box_key;
     31 		echo '<input type="radio" id="'.$id.'" name="'.$name.'" value="' . $box_key . '" title="' . $box_title . '"';
     32 		
     33 		if ((string) $box_key == $value)
     34 			echo ' checked="checked"';
     35 		
     36 		echo ' />&nbsp;<label for="'.$id.'">'.$box_value.'</label><br />';
     37 	}
     38 }
     39 
     40 ?>