function __construct($params) { if (array_key_exists('other', $params)) { } elseif (array_key_exists('other-message', $params)) { $params['other'] = wfMessage($params['other-message'])->plain(); } else { $params['other'] = null; } parent::__construct($params); if ($this->getOptions() === null) { # Sulk throw new MWException('HTMLSelectAndOtherField called without any options'); } if (!in_array('other', $this->mOptions, true)) { $this->mOptions[$params['other']] = 'other'; } $this->mFlatOptions = self::flattenOptions($this->getOptions()); }
function __construct($params) { if (array_key_exists('other', $params)) { } elseif (array_key_exists('other-message', $params)) { $params['other'] = wfMessage($params['other-message'])->plain(); } else { $params['other'] = wfMessage('htmlform-selectorother-other')->plain(); } parent::__construct($params); if ($this->getOptions() === null) { # Sulk throw new MWException('HTMLSelectAndOtherField called without any options'); } if (!in_array('other', $this->mOptions, true)) { // Have 'other' always as first element $this->mOptions = array($params['other'] => 'other') + $this->mOptions; } $this->mFlatOptions = self::flattenOptions($this->getOptions()); }
function __construct($params) { if (array_key_exists('other', $params)) { } elseif (array_key_exists('other-message', $params)) { $params['other'] = wfMessage($params['other-message'])->plain(); } else { $params['other'] = null; } if (array_key_exists('options', $params)) { # Options array already specified } elseif (array_key_exists('options-message', $params)) { # Generate options array from a system message $params['options'] = self::parseMessage(wfMessage($params['options-message'])->inContentLanguage()->plain(), $params['other']); } else { # Sulk throw new MWException('HTMLSelectAndOtherField called without any options'); } $this->mFlatOptions = self::flattenOptions($params['options']); parent::__construct($params); }
public function __construct($params) { parent::__construct($params); $this->mClass .= " ep-combobox-tr"; }