コード例 #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);
 }
コード例 #2
0
ファイル: RadioYesNo.php プロジェクト: ming-hai/XoopsCore
 /**
  * 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')]);
 }
コード例 #3
0
ファイル: Multibox.php プロジェクト: felixarntz/wpdlib
 /**
  * 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;
 }
コード例 #4
0
ファイル: Checkbox.php プロジェクト: popytka008/classes
 public function __construct($name = null, $owner = null, $value = null, $checked = Cons::NO)
 {
     parent::__construct($name, $owner, $value);
     $this->type = "checkbox";
     $this->checked = $checked;
 }
コード例 #5
0
ファイル: ui_helper.php プロジェクト: pkdism/ISM-MIS
 public function __construct()
 {
     parent::__construct();
     $this->properties['type'] = 'checkbox';
     $this->containerClasses('checkbox');
     log_message('debug', "UI_helper > Radio Class Initialized");
 }
コード例 #6
0
ファイル: RadioYesNo.php プロジェクト: redmexico/XoopsCore
 /**
  * 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);
 }