Exemplo n.º 1
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     $var = $object->vars[$key];
     $control = $object->getControl($key);
     if (isset($control['delimeter'])) {
         $this->_delimeter = $control['delimeter'];
     }
     parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $this->_delimeter);
     // Adding the options inside this Radio element
     // If the custom method is not from a module, than it's from the core
     if (isset($control['options'])) {
         $this->addOptionArray($control['options']);
     } else {
         // let's find out if the method we need to call comes from an already defined object
         if (isset($control['object'])) {
             if (method_exists($control['object'], $control['method'])) {
                 if ($option_array = $control['object']->{$control}['method']()) {
                     // Adding the options array to the Radio element
                     $this->addOptionArray($option_array);
                 }
             }
         } else {
             // finding the itemHandler; if none, let's take the itemHandler of the $object
             if (isset($control['itemHandler'])) {
                 if (!$control['module']) {
                     // Creating the specified core object handler
                     $control_handler = icms::handler($control['itemHandler']);
                 } else {
                     $control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
                 }
             } else {
                 $control_handler =& $object->handler;
             }
             // Checking if the specified method exists
             if (method_exists($control_handler, $control['method'])) {
                 // TODO : How could I pass the parameters in the following call ...
                 if ($option_array = $control_handler->{$control}['method']()) {
                     // Adding the options array to the Radio element
                     $this->addOptionArray($option_array);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param	string	$caption
  * @param	string	$name
  * @param	string	$value		Pre-selected value, can be "0" (No) or "1" (Yes)
  * @param	string	$yes		String for "Yes"
  * @param	string	$no			String for "No"
  */
 public function __construct($caption, $name, $value = null, $yes = _YES, $no = _NO)
 {
     parent::__construct($caption, $name, $value);
     $this->addOption(1, ' ' . $yes . ' ');
     $this->addOption(0, ' ' . $no);
 }
Exemplo n.º 3
0
 public function __construct($caption, $name, $value = null, $delimeter = "")
 {
     parent::__construct($caption, $name, $value, $delimeter);
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_form_elements_Radio', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }