tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Source for file form_field_radio_group_view.class.php

Documentation is available at form_field_radio_group_view.class.php

  1. <?php
  2. // *** Tangra (Application Framework and Tools for PHP)
  3. //  $Id$
  4. //
  5.  
  6. /**
  7.  * Contains class Form_Field_Checkbox_View
  8.  *
  9.  * @package tangra_lib
  10.  * @subpackage form
  11.  */
  12.  
  13. /**
  14.  *
  15.  */
  16. require_once(TANGRA_MAIN_DIR.'form/fields/form_field_view.class.php');
  17. /**
  18.  *
  19.  */
  20. require_once(TANGRA_MAIN_DIR.'form/fields/radio_group/form_field_radio_group.class.php');
  21.  
  22. /**
  23.  * View class for Form_Field_Radio_Group
  24.  *
  25.  * @package tangra_lib
  26.  * @subpackage form
  27.  */
  28.     /**
  29.      * Constructor
  30.      *
  31.      * @param string $tpl_name Field name for template
  32.      * @param Form_Field_Radio_Group $field Field object
  33.      */
  34.     function __construct($tpl_nameForm_Field_Radio_Group $field{
  35.         parent::__construct($tpl_name$field);
  36.     }
  37.  
  38.  
  39.     /**
  40.      * Returns TPLE exports
  41.      *
  42.      * @return TPLE_Exports 
  43.      */
  44.     public function get_tple_exports({
  45.         $exports parent::get_tple_exports();
  46.  
  47.         $radios $this->field->get_radios();
  48.  
  49.         foreach($radios as $radio{
  50.             $exports->add_pair($this->get_tpl_name().'_'.$radio['html_value']$radio['html_value']);
  51.             $exports->add_pair($this->get_tpl_name().'_'.$radio['html_value'].'_checked'$radio['checked']);
  52.         }
  53.  
  54.         return $exports;
  55.     }
  56. }