function __construct($params)
 {
     $params += array('require-match' => false);
     parent::__construct($params);
     if (array_key_exists('autocomplete-messages', $this->mParams)) {
         foreach ($this->mParams['autocomplete-messages'] as $key => $value) {
             $key = $this->msg($key)->plain();
             $this->autocomplete[$key] = strval($value);
         }
     } elseif (array_key_exists('autocomplete', $this->mParams)) {
         foreach ($this->mParams['autocomplete'] as $key => $value) {
             $this->autocomplete[$key] = strval($value);
         }
     }
     if (!is_array($this->autocomplete) || !$this->autocomplete) {
         throw new MWException('HTMLAutoCompleteSelectField called without any autocompletions');
     }
     $this->getOptions();
     if ($this->mOptions && !in_array('other', $this->mOptions, true)) {
         if (isset($params['other-message'])) {
             $msg = wfMessage($params['other-message'])->text();
         } elseif (isset($params['other'])) {
             $msg = $params['other'];
         } else {
             $msg = wfMessage('htmlform-selectorother-other')->text();
         }
         $this->mOptions[$msg] = 'other';
     }
 }
Esempio n. 2
0
 public function __construct($params)
 {
     parent::__construct($params);
     $this->mType = array_key_exists('type', $params) ? $params['type'] : 'datetime';
     if (!in_array($this->mType, ['date', 'time', 'datetime'])) {
         throw new InvalidArgumentException("Invalid type '{$this->mType}'");
     }
     $this->mClass .= ' mw-htmlform-datetime-field';
 }
 function __construct($params)
 {
     parent::__construct($params);
     $this->getOptions();
     if (!in_array('other', $this->mOptions, true)) {
         $msg = isset($params['other']) ? $params['other'] : wfMessage('htmlform-selectorother-other')->text();
         $this->mOptions[$msg] = 'other';
     }
 }
 function __construct($params)
 {
     parent::__construct($params);
     $this->getOptions();
     if (!in_array('other', $this->mOptions, true)) {
         $msg = isset($params['other']) ? $params['other'] : wfMessage('htmlform-selectorother-other')->text();
         // Have 'other' always as first element
         $this->mOptions = array($msg => 'other') + $this->mOptions;
     }
 }
Esempio n. 5
0
 function __construct($params)
 {
     if (!in_array('other', $params['options'], true)) {
         $msg = isset($params['other']) ? $params['other'] : wfMessage('htmlform-selectorother-other')->text();
         $params['options'][$msg] = 'other';
     }
     parent::__construct($params);
 }
 public function __construct($params)
 {
     $params += ['namespace' => false, 'relative' => false, 'creatable' => false, 'exists' => false];
     parent::__construct($params);
 }
 public function __construct($params)
 {
     $params += array('exists' => false, 'ipallowed' => false);
     parent::__construct($params);
 }
 public function __construct($info)
 {
     $this->mClassWithButton = new HTMLFormFieldWithButton($info);
     parent::__construct($info);
 }
Esempio n. 9
0
 public function __construct($params)
 {
     $params += array('namespace' => false, 'creatable' => false, 'exists' => false);
     parent::__construct($params);
 }
Esempio n. 10
0
 function __construct($params)
 {
     if (!in_array('other', $params['options'], true)) {
         $params['options'][wfMsg('htmlform-selectorother-other')] = 'other';
     }
     parent::__construct($params);
 }
Esempio n. 11
0
 public function __construct($params)
 {
     parent::__construct($params);
     $this->mClass .= " ep-datepicker-tr";
 }