42 if ($plugin = \
Xoops\Module\Plugin::getPlugin($mod->
getVar(
'dirname'),
'userconfigs')) {
44 parent::__construct(
'',
'pref_form',
'index.php',
'post',
true);
45 if ($mod->
getVar(
'dirname') !=
'system') {
46 $xoops->loadLanguage(
'modinfo', $mod->
getVar(
'dirname'));
50 $configNames = array();
54 $configCats = $plugin->categories();
64 if (!in_array(
'default', array_keys($configCats))) {
65 $configCats[
'default'] = array(
71 foreach (array_keys($configNames) as
$name) {
72 if (!isset($configNames[$name][
'category'])) {
73 $configNames[
$name][
'category'] =
'default';
79 foreach ($configCats as $name =>
$info) {
81 if (isset(
$info[
'description']) &&
$info[
'description'] !=
'') {
82 $tabs[
$name]->addElement(
new Xoops\Form\Label(
'',
$info[
'description']));
89 switch ($obj[$i]->getVar(
'conf_formtype')) {
93 if ($obj[$i]->getVar(
'conf_valuetype') ==
'array') {
95 $ele = ($obj[
$i]->getVar(
'conf_value') !=
'') ?
new Xoops\Form\TextArea(
$title, $obj[$i]->getVar(
'conf_name'),
$myts->htmlspecialchars(implode(
'|', $obj[$i]->getConfValueForOutput())), 5, 5) :
new Xoops\Form\TextArea(
$title, $obj[$i]->getVar(
'conf_name'),
'', 5, 5);
105 for (
$j = 0;
$j < $opcount; ++
$j) {
108 $ele->addOption($optval, $optkey);
113 $ele =
new Xoops\Form\Select(
$title, $obj[$i]->getVar(
'conf_name'), $obj[$i]->getConfValueForOutput(), 5,
true);
116 for (
$j = 0;
$j < $opcount; ++
$j) {
119 $ele->addOption($optval, $optkey);
129 $ele = ($obj[
$i]->getVar(
'conf_formtype') !=
'theme_multi') ?
new Xoops\Form\Select(
$title, $obj[$i]->getVar(
'conf_name'), $obj[
$i]->getConfValueForOutput()) :
new Xoops\Form\Select(
$title, $obj[$i]->getVar(
'conf_name'), $obj[
$i]->getConfValueForOutput(), 5,
true);
130 $dirlist = XoopsLists::getThemesList();
138 $tplset_handler =
$xoops->getHandlerTplset();
139 $tplsetlist = $tplset_handler->getNameList();
141 foreach ($tplsetlist as $key => $name) {
142 $ele->addOption($key, $name);
147 $ele =
new Xoops\Form\Hidden($obj[$i]->getVar(
'conf_name'), $obj[$i]->getConfValueForOutput());
175 $ele->addOptionArray($moduleslist);
197 $currrent_val = $obj[
$i]->getConfValueForOutput();
198 $cache_options = array(
214 $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
216 $selform->addOptionArray($cache_options);
217 $ele->addElement($selform);
227 $ele->addOptionArray(array(
254 $ele =
new Xoops\Form\Hidden($obj[$i]->getVar(
'conf_name'),
$myts->htmlspecialchars($obj[$i]->getConfValueForOutput()));
260 $ele =
new Xoops\Form\Text(
$title, $obj[$i]->getVar(
'conf_name'), 5, 255,
$myts->htmlspecialchars($obj[$i]->getConfValueForOutput()));
265 $ele->setDescription($desc);
266 if ($obj[$i]->getVar(
'conf_formtype') !=
'hidden') {
268 if (isset($configNames[$obj[$i]->getVar(
'conf_name')][
'category'])) {
269 $name = $configNames[$obj[
$i]->getVar(
'conf_name')][
'category'];
271 $tabs[
$name]->addElement($ele);
280 foreach (array_keys($tabs) as $name) {
282 $tabtray->addElement($tabs[$name]);
getVar($key, $format= 's')
if($_SERVER['REQUEST_METHOD']== 'POST') $config_handler
if(isset($_POST['name'])) $info
static translate($key, $dirname= 'xoops')
const _MD_USERCONFIGS_CONFIGS