Exemplo n.º 1
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array("1" => "Yes", "0" => "No");
     if (!is_array($properties)) {
         $properties = array("inline" => 1);
     } elseif (!array_key_exists("inline", $properties)) {
         $properties["inline"] = 1;
     }
     parent::__construct($label, $name, $options, $properties);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param string|array $caption Caption or array of all attributes
  *                               Control attributes:
  *                                   :yes label for '1' response
  *                                   :no  label for '0' response
  * @param string       $name    element name
  * @param string|null  $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 = null, $value = null, $yes = \XoopsLocale::YES, $no = \XoopsLocale::NO)
 {
     parent::__construct($caption, $name, $value, true);
     if (is_array($caption)) {
         $this->set(':inline');
         $this->setIfNotSet(':yes', \XoopsLocale::YES);
         $this->setIfNotSet(':no', \XoopsLocale::NO);
     } else {
         $this->setWithDefaults(':yes', $yes, \XoopsLocale::YES);
         $this->setWithDefaults(':no', $no, \XoopsLocale::NO);
     }
     $this->addOptionArray([1 => $this->get(':yes'), 0 => $this->get(':no')]);
 }
Exemplo n.º 3
0
 /**
  * Class constructor.
  *
  * For an overview of the supported arguments, please read the Field Types Reference.
  *
  * @since 0.5.0
  * @param string $type the field type
  * @param array $args array of field type arguments
  */
 public function __construct($type, $args)
 {
     parent::__construct($type, $args);
     $this->args['multiple'] = true;
 }
Exemplo n.º 4
0
 public function __construct($name = null, $owner = null, $value = null, $checked = Cons::NO)
 {
     parent::__construct($name, $owner, $value);
     $this->type = "checkbox";
     $this->checked = $checked;
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
     $this->properties['type'] = 'checkbox';
     $this->containerClasses('checkbox');
     log_message('debug', "UI_helper > Radio Class Initialized");
 }
Exemplo n.º 6
0
 /**
  * Constructor
  *
  * @param string      $caption caption
  * @param string      $name    element name
  * @param string|null $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 = \XoopsLocale::YES, $no = \XoopsLocale::NO)
 {
     parent::__construct($caption, $name, $value, true);
     $this->addOption(1, $yes);
     $this->addOption(0, $no);
 }