function render() { require_once ABSPATH . "/class/exmlists.php"; $themes = EXMLists::getLangList(); if ($this->type) { $rtn = "<table cellpadding='2' cellspacing='1' border='0'><tr>"; $i = 1; foreach ($themes as $k) { if ($i > $this->cols) { $rtn .= "</tr><tr>"; $i = 1; } $rtn .= "<td width='" . (int) (100 / $this->cols) . "%'>"; if ($this->multi) { $rtn .= "<label><input type='checkbox' value='{$k}' name='" . $this->getName() . "[]' id='" . $this->getName() . "[]'" . (is_array($this->selected) ? in_array($k, $this->selected) ? " checked='checked'" : '' : '') . " /> {$k}</label>"; } else { $rtn .= "<label><input type='radio' value='{$k}' name='" . $this->getName() . "' id='" . $this->getName() . "'" . (!empty($this->selected) ? $k == $this->selected ? " checked='checked'" : '' : '') . " /> {$k}</label>"; } $rtn .= "</td>"; $i++; } $rtn .= "</tr></table>"; } else { if ($this->multi) { $rtn = "<select name='" . $this->getName() . "[]' id='" . $this->getName() . "[]' size='{$this->cols}' multiple='multiple'>"; foreach ($themes as $k) { $rtn .= "<option value='{$k}'" . (is_array($this->selected) ? in_array($k, $this->selected) ? " selected='selected'" : '' : '') . ">{$k}</option>"; } $rtn .= "</select>"; } else { $rtn = "<select name='" . $this->getName() . "' id='" . $this->getName() . "'>"; foreach ($themes as $k) { $rtn .= "<option value='{$k}'" . (!empty($this->selected) ? $k == $this->selected ? " selected='selected'" : '' : '') . ">{$k}</option>"; } $rtn .= "</select>"; } } return $rtn; }