forked from wakachamo/PsychoStats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.php
62 lines (54 loc) · 1.91 KB
/
themes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* This file is part of PsychoStats.
*
* Written by Jason Morriss <stormtrooper@psychostats.com>
* Copyright 2008 Jason Morriss
*
* PsychoStats is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PsychoStats is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PsychoStats. If not, see <http://www.gnu.org/licenses/>.
*
* Version: $Id: themes.php 402 2008-04-21 14:55:05Z lifo $
*/
define("PSYCHOSTATS_PAGE", true);
include(dirname(__FILE__) . "/includes/common.php");
$cms->init_theme($ps->conf['main']['theme'], $ps->conf['theme']);
$ps->theme_setup($cms->theme);
$cms->theme->page_title('PsychoStats - Theme Gallery');
// collect url parameters ...
$validfields = array('t');
$cms->theme->assign_request_vars($validfields, true);
$t = trim($t);
$themes = $cms->theme->get_theme_list();
// update the user's theme if they selected one from the list
if ($t) {
if ($cms->theme->is_theme($t, true)) {
$cms->session->opt('theme', $t);
$cms->session->save_session_options();
} else {
// report an error?
// na... just silently ignore the language
// trigger_error("Invalid theme specified!", E_USER_WARNING);
}
previouspage($PHP_SELF . "#" . ps_escape_html($t));
}
// assign variables to the theme
$cms->theme->assign(array(
'themes' => $themes,
'theme' => $cms->theme->theme,
));
// display the output
$basename = basename(__FILE__, '.php');
//$cms->theme->add_js('js/themes.js');
$cms->full_page($basename, $basename, $basename.'_header', $basename.'_footer');
?>