49 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css');
51 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
52 $xoTheme->addScript(
'modules/system/js/admin.js');
65 if (!is_object($confcat)) {
68 $xoBreadCrumb->addLink( constant( $confcat->getVar(
'confcat_name') ) );
73 $form =
new XoopsThemeForm( constant( $confcat->getVar(
'confcat_name') ),
'pref_form',
'admin.php?fct=preferences',
'post',
true);
80 for (
$i = 0;
$i < $confcount;
$i++) {
82 $desc = (
$config[
$i]->getVar(
'conf_desc') !=
'') ? constant(
$config[
$i]->getVar(
'conf_desc') ) :
'';
84 switch (
$config[
$i]->getVar(
'conf_formtype')) {
88 if (
$config[
$i]->getVar(
'conf_valuetype') ==
'array') {
100 for (
$j = 0;
$j < $opcount;
$j++) {
103 $ele->addOption($optval, $optkey);
111 for (
$j = 0;
$j < $opcount;
$j++) {
114 $ele->addOption($optval, $optkey);
124 $ele = (
$config[
$i]->getVar(
'conf_formtype')
126 require_once XOOPS_ROOT_PATH .
'/class/xoopslists.php';
127 $dirlist = XoopsLists::getThemesList();
132 $valueForOutput =
$config[
$i]->getConfValueForOutput();
133 $form->addElement(
new XoopsFormHidden(
'_old_theme', (is_array($valueForOutput) ? $valueForOutput[0] : $valueForOutput)));
139 $tplsetlist = $tplset_handler->getList();
141 foreach ($tplsetlist as $key => $name) {
142 $ele->addOption($key, $name);
152 $ele->addOptionArray( $list );
170 $ele->addOptionArray($moduleslist);
193 $currrent_val =
$config[
$i]->getConfValueForOutput();
194 $cache_options = array(
'0' =>
_NOCACHE,
'30' => sprintf(
_SECONDS, 30),
'60' =>
_MINUTE,
'300' => sprintf(
_MINUTES, 5),
'1800' => sprintf(
_MINUTES, 30),
'3600' =>
_HOUR,
'18000' => sprintf(
_HOURS, 5),
'86400' =>
_DAY,
'259200' => sprintf(
_DAYS, 3),
'604800' =>
_WEEK);
195 if (count($modules) > 0) {
197 foreach (array_keys($modules) as
$mid) {
198 $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
200 $selform->addOptionArray($cache_options);
201 $ele->addElement($selform);
211 $ele->addOptionArray(array(
'0' =>
_NOCACHE,
'30' => sprintf(
_SECONDS, 30),
'60' =>
_MINUTE,
'300' => sprintf(
_MINUTES, 5),
'1800' => sprintf(
_MINUTES, 30),
'3600' =>
_HOUR,
'18000' => sprintf(
_HOURS, 5),
'86400' =>
_DAY,
'259200' => sprintf(
_DAYS, 3),
'604800' =>
_WEEK));
237 $ele->setDescription($desc);
238 $form->addElement($ele);
239 $form->addElement($hidden);
253 header(
'Location: admin.php?fct=preferences');
261 include_once XOOPS_ROOT_PATH .
'/class/xoopsformloader.php';
269 if (
$module->getVar(
'hascomments') == 1) {
274 if (
$module->getVar(
'hasnotification') == 1) {
278 $modname =
$module->getVar(
'name');
282 } elseif (
$module->getInfo(
'adminindex')) {
285 for (
$i = 0;
$i < $count;
$i++) {
287 $description = (defined(
$config[
$i]->getVar(
'conf_desc'))) ? constant(
$config[
$i]->getVar(
'conf_desc')) :
'';
288 switch (
$config[
$i]->getVar(
'conf_formtype')) {
292 if (
$config[
$i]->getVar(
'conf_valuetype') ==
'array') {
304 for (
$j = 0;
$j < $opcount;
$j++) {
307 $ele->addOption($optval, $optkey);
315 for (
$j = 0;
$j < $opcount;
$j++) {
318 $ele->addOption($optval, $optkey);
327 include_once XOOPS_ROOT_PATH .
'/class/xoopslists.php';
332 include_once XOOPS_ROOT_PATH .
'/class/xoopslists.php';
338 include_once XOOPS_ROOT_PATH .
'/class/xoopslists.php';
343 include_once XOOPS_ROOT_PATH .
'/class/xoopslists.php';
375 $ele->setDescription($description);
376 $form->addElement($ele);
379 $form->addElement($hidden);
385 if (
$module->getVar(
'name') ==
'System'){
391 if (
$module->getInfo(
'adminindex')) {
392 echo
'<a href="' . XOOPS_URL .
'/modules/' .
$module->getVar(
'dirname') .
'/' .
$module->getInfo(
'adminindex') .
'">' .
$module->getVar(
'name') .
'</a> <span style="font-weight:bold;">»»</span> ' .
_PREFERENCES .
'<br /><br />';
394 echo
$module->getVar(
'name') .
' <span style="font-weight:bold;">»»</span> ' .
_PREFERENCES .
'<br /><br />';
401 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
404 require_once XOOPS_ROOT_PATH .
'/class/template.php';
406 $count = count($conf_ids);
407 $tpl_updated =
false;
408 $theme_updated =
false;
409 $startmod_updated =
false;
410 $lang_updated =
false;
412 for (
$i = 0;
$i < $count;
$i++) {
414 $new_value =& ${
$config->getVar(
'conf_name')};
415 if (is_array($new_value) || $new_value !=
$config->getVar(
'conf_value')) {
419 $lang_updated =
true;
423 if (!$theme_updated &&
$config->getVar(
'conf_catid') ==
XOOPS_CONF &&
$config->getVar(
'conf_name') ==
'theme_set') {
426 $theme_updated =
true;
430 if (!$tpl_updated &&
$config->getVar(
'conf_catid') ==
XOOPS_CONF &&
$config->getVar(
'conf_name') ==
'template_set') {
433 $newtplset = ${
$config->getVar(
'conf_name')};
441 $dtemplates = $tplfile_handler->find(
'default',
'block');
442 $dcount = count($dtemplates);
445 $GLOBALS[
'xoopsConfig'][
'template_set'] = $newtplset;
447 for (
$j = 0;
$j < $dcount;
$j++) {
448 $found = $tplfile_handler->find($newtplset,
'block', $dtemplates[
$j]->getVar(
'tpl_refid'), null);
449 if (count($found) > 0) {
461 foreach (array_keys($imagefiles) as
$j) {
462 if (!$fp = fopen(
XOOPS_CACHE_PATH .
'/' . $newtplset .
'_' . $imagefiles[$j]->getVar(
'imgsetimg_file'),
'wb')) {
464 fwrite($fp, $imagefiles[$j]->getVar(
'imgsetimg_body'));
473 if (!$startmod_updated && $new_value !=
'--' &&
$config->getVar(
'conf_catid') ==
XOOPS_CONF &&
$config->getVar(
'conf_name') ==
'startpage') {
479 foreach (
$groups as $groupid => $groupname) {
484 $startmod_updated =
true;
487 $config->setConfValueForInput($new_value);
494 if (!empty($use_mysession) &&
$xoopsConfig[
'use_mysession'] == 0 && $session_name !=
'') {
495 setcookie($session_name, session_id(), time()+(60*intval($session_expire)),
'/',
XOOPS_COOKIE_DOMAIN, 0);
501 require_once XOOPS_ROOT_PATH.
'/modules/system/class/maintenance.php';
505 register_shutdown_function(array(&$maintenance,
'CleanCache' ),
$options);
513 if (isset($redirect) && $redirect !=
'') {
527 $confcats = $confcat_handler->getObjects();
530 $nbcolonnes_pref = 5;
531 foreach ( array_keys($confcats) as $i ) {
532 $preferences[
'id'] = $confcats[
$i]->getVar(
'confcat_id');
534 $preferences[
'name'] = constant( $confcats[$i]->getVar(
'confcat_name') );
536 $preferences[
'newline'] = ($count_prefs % $nbcolonnes_pref == 1) ?
true :
false;
537 $xoopsTpl->assign(
'newline', $preferences[
'newline']);
539 $xoopsTpl->append_by_ref(
'preferences', $preferences);
540 unset( $preferences );