25 defined(
'XOOPS_INSTALL') or die('XOOPS Custom Installation die');
40 $confcount = count($config);
42 for (
$i = 0;
$i < $confcount; ++
$i) {
43 $conf_catid = $config[
$i]->getVar(
'conf_catid');
44 if (!isset($ret[$conf_catid])) {
50 switch ($config[
$i]->getVar(
'conf_formtype')) {
54 if ($config[
$i]->getVar(
'conf_valuetype') ==
'array') {
56 $ele = ($config[
$i]->getVar(
'conf_value') !=
'') ?
new Xoops\Form\TextArea($title, $config[
$i]->getVar(
'conf_name'),
$myts->htmlspecialchars(implode(
'|', $config[
$i]->getConfValueForOutput())), 5, 50) :
new Xoops\Form\TextArea($title, $config[
$i]->getVar(
'conf_name'),
'', 5, 50);
58 $ele =
new Xoops\Form\TextArea($title, $config[
$i]->getVar(
'conf_name'),
$myts->htmlspecialchars($config[
$i]->getConfValueForOutput()), 5, 100);
63 $ele =
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput());
66 for (
$j = 0;
$j < $opcount; ++
$j) {
69 $ele->addOption($optval, $optkey);
74 $ele =
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput(), 5,
true);
77 for (
$j = 0;
$j < $opcount; ++
$j) {
80 $ele->addOption($optval, $optkey);
90 $ele = ($config[
$i]->getVar(
'conf_formtype') !=
'theme_multi')
91 ?
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput())
92 :
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput(), 5,
true);
93 $dirlist = XoopsLists::getThemesList();
101 $ele =
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput());
102 $tplset_handler =
$xoops->getHandlerTplset();
103 $tplsetlist = $tplset_handler->getNameList();
105 foreach ($tplsetlist as $key =>
$name) {
106 $ele->addOption($key,
$name);
123 $ele =
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput());
129 $ele->addOptionArray($moduleslist);
133 $ele =
new Xoops\Form\SelectGroup($title, $config[
$i]->getVar(
'conf_name'),
false, $config[
$i]->getConfValueForOutput(), 1,
false);
137 $ele =
new Xoops\Form\SelectGroup($title, $config[
$i]->getVar(
'conf_name'),
false, $config[
$i]->getConfValueForOutput(), 5,
true);
142 $ele =
new Xoops\Form\SelectUser($title, $config[
$i]->getVar(
'conf_name'),
false, $config[
$i]->getConfValueForOutput(), 1,
false);
146 $ele =
new Xoops\Form\SelectUser($title, $config[
$i]->getVar(
'conf_name'),
false, $config[
$i]->getConfValueForOutput(), 5,
true);
152 $currrent_val = $config[
$i]->getConfValueForOutput();
153 $cache_options = array(
169 $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
171 $selform->addOptionArray($cache_options);
172 $ele->addElement($selform);
181 $ele =
new Xoops\Form\Select($title, $config[
$i]->getVar(
'conf_name'), $config[
$i]->getConfValueForOutput());
182 $ele->addOptionArray(array(
199 $ele =
new Xoops\Form\Password($title, $config[
$i]->getVar(
'conf_name'), 50, 255,
$myts->htmlspecialchars($config[
$i]->getConfValueForOutput()));
209 $ele =
new Xoops\Form\Hidden($config[
$i]->getVar(
'conf_name'),
$myts->htmlspecialchars($config[
$i]->getConfValueForOutput()));
215 $ele =
new Xoops\Form\Text($title, $config[
$i]->getVar(
'conf_name'), 50, 255,
$myts->htmlspecialchars($config[
$i]->getConfValueForOutput()));
219 if ($config[
$i]->getVar(
'conf_desc') !=
'') {
222 $ret[$conf_catid]->addElement($ele);
225 $ret[$conf_catid]->addElement($hidden);
242 $dirlist = XoopsLists::getThemesList();
243 if (!empty($dirlist)) {
245 $form_theme_set->addOptionArray($dirlist);
251 foreach ($dirlist as $theme) {
264 'thumbnail' =>
'screenshot.gif',
265 'screenshot' =>
'screenshot.png',
269 $label_content .=
"<div id='$theme' rel='theme' style='display:block;'>";
271 $label_content .=
"<div id='$theme' rel='theme' style='display:none;'>";
273 if (file_exists(XOOPS_ROOT_PATH .
"/themes/$theme/theme.ini")) {
274 $theme_ini = parse_ini_file(XOOPS_ROOT_PATH .
"/themes/$theme/theme.ini");
275 if ($theme_ini[
'screenshot'] ==
'') {
276 $theme_ini[
'screenshot'] =
'screenshot.png';
277 $theme_ini[
'thumbnail'] =
'thumbnail.png';
281 if ($theme_ini[
'screenshot'] !=
'' && file_exists(XOOPS_ROOT_PATH .
"/themes/$theme/" . $theme_ini[
'screenshot'])) {
282 $label_content .=
"<img src='" . XOOPS_URL .
"/themes/" . $theme .
"/" . $theme_ini[
'screenshot'] .
"' alt='Screenshot' />";
283 } elseif ($theme_ini[
'thumbnail'] !=
'' && file_exists(XOOPS_ROOT_PATH .
"/themes/$theme/" . $theme_ini[
'thumbnail'])) {
284 $label_content .=
"<img src='" . XOOPS_URL .
"/themes/" . $theme .
"/" . $theme_ini[
'thumbnail'] .
"' alt='$theme' />";
288 $label_content .=
"</div>";
292 $form_theme_set->setExtra(
"onchange='showThemeSelected(this)'");
295 $form->addElement($form_theme_set);
296 $form->addElement(
new Xoops\Form\Label(
'',
"<div id='screenshot'>" . $label_content .
"</div>"));
298 $form->addElement(
new Xoops\Form\Hidden(
'conf_ids[]', $config->
getVar(
'conf_id')));
getVar($key, $format= 's')
if($_SERVER['REQUEST_METHOD']== 'POST') $config_handler
static translate($key, $dirname= 'xoops')
const THEME_NO_SCREENSHOT