PHP Classes

File: htdocs/install/page_theme.php

Recommend this page to a friend!
  Classes of Michael Beck   Xoops 2.5   htdocs/install/page_theme.php   Download  
File: htdocs/install/page_theme.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change: non-canonical order

In docblock var tags, use "type variableName" more consistently
Date: 5 years ago
Size: 2,258 bytes
 

Contents

Class file image Download
<?php
/**
 * See the enclosed file license.txt for licensing information.
 * If you did not receive this file, get it at http://www.gnu.org/licenses/gpl-2.0.html
 *
 * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package installer
 * @since 2.3.0
 * @author Haruki Setoyama <[email protected]>
 * @author Kazumi Ono <[email protected]>
 * @author Skalpa Keo <[email protected]>
 * @author Taiwen Jiang <[email protected]>
 * @author DuGris (aka L. JEN) <[email protected]>
 **/

$xoopsOption['checkadmin'] = true;
$xoopsOption['hascommon'] = true;
require_once
'./include/common.inc.php';
defined('XOOPS_INSTALL') || die('XOOPS Installation wizard die');

if (
$_SERVER['REQUEST_METHOD'] === 'POST') {
   
/* @var XoopsConfigHandler $config_handler */
   
$config_handler = xoops_getHandler('config');
    if (
array_key_exists('conf_ids', $_REQUEST)) {
        foreach (
$_REQUEST['conf_ids'] as $key => $conf_id) {
           
$config = $config_handler->getConfig($conf_id);
           
$new_value = $_REQUEST[$config->getVar('conf_name')];
           
$config->setConfValueForInput($new_value);
           
$config_handler->insertConfig($config);
        }
    }

   
/* @var XoopsMemberHandler $member_handler */
   
$member_handler = xoops_getHandler('member');
   
$member_handler->updateUsersByField('theme', $new_value);

   
$wizard->redirectToPage('+1');
}

$pageHasForm = true;
$pageHasHelp = false;

if (!@include_once
"../modules/system/language/{$wizard->language}/admin/preferences.php") {
    include_once
'../modules/system/language/english/admin/preferences.php';
}

/* @var XoopsConfigHandler $config_handler */
$config_handler = xoops_getHandler('config');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('conf_modid', 0));
$criteria->add(new Criteria('conf_name', 'theme_set'));

$tempConfig = $config_handler->getConfigs($criteria);
$config = array_pop($tempConfig);
include
'./include/createconfigform.php';
$wizard->form = createThemeform($config);
$content = $wizard->CreateForm();

include
'./include/install_tpl.php';