-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathselector.php
More file actions
83 lines (69 loc) · 2.68 KB
/
selector.php
File metadata and controls
83 lines (69 loc) · 2.68 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent 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 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) exit('');
// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) require_once(BASE.'subsystems/theme.php');
$section = (exponent_sessions_isset('last_section') ? exponent_sessions_get('last_section') : SITE_DEFAULT_SECTION);
$section = $db->selectObject('section','id='.$section);
// Handle sub themes
$page = ($section && $section->subtheme != '' && is_readable('themes/'.DISPLAY_THEME.'/subthemes/'.$section->subtheme.'.php') ?
'themes/'.DISPLAY_THEME.'/subthemes/'.$section->subtheme.'.php' :
'themes/'.DISPLAY_THEME.'/index.php'
);
if (is_readable(BASE.$page)) {
define('PREVIEW_READONLY',1); // for mods
define('SELECTOR',1);
$SYS_FLOW_REDIRECTIONPATH='source_selector';
$source_select = array();
if (exponent_sessions_isset('source_select')) $source_select = exponent_sessions_get('source_select');
$count_orig = count($source_select);
if (isset($_REQUEST['vview'])) {
$source_select['view'] = $_REQUEST['vview'];
} else if (!isset($source_select['view'])) {
$source_select['view'] = '_sourcePicker';
}
if (isset($_REQUEST['vmod'])) {
$source_select['module'] = $_REQUEST['vmod'];
} else if (!isset($source_select['module'])) {
$source_select['module'] = 'containermodule';
}
if (isset($_REQUEST['showmodules'])) {
if (is_array($_REQUEST['showmodules'])) $source_select['showmodules'] = $_REQUEST['showmodules'];
else if ($_REQUEST['showmodules'] == 'all') $source_select['showmodules'] = null;
else $source_select['showmodules'] = explode(',',$_REQUEST['showmodules']);
} else if (!isset($source_select['showmodules'])) {
$source_select['showmodules'] = null;
}
if (isset($_REQUEST['dest'])) {
$source_select['dest'] = $_REQUEST['dest'];
} else if (!isset($source_select['dest'])) {
$source_select['dest'] = null;
}
if (isset($_REQUEST['hideOthers'])) {
$source_select['hideOthers'] = $_REQUEST['hideOthers'];
} else if (!isset($source_select['hideOthers'])) {
$source_select['hideOthers'] = 0;
}
exponent_sessions_set('source_select',$source_select);
// Include the rendering page.
include_once(BASE.$page);
} else {
$i18n = exponent_lang_loadFile('selector.php');
echo sprintf($i18n['not_readable'],BASE.$page);
}
?>