-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathedit_page.php
More file actions
71 lines (58 loc) · 1.95 KB
/
edit_page.php
File metadata and controls
71 lines (58 loc) · 1.95 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
<?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
#
##################################################
define('SCRIPT_EXP_RELATIVE','');
define('SCRIPT_FILENAME','edit_page.php');
ob_start();
include_once('exponent.php');
if (!defined("EXPONENT")) exit("");
if (!defined('SYS_THEME')) include_once(BASE.'subsystems/theme.php');
$id = -1;
if (isset($_GET['sitetemplate_id'])) {
exponent_sessions_set('sitetemplate_id',intval($_GET['sitetemplate_id']));
$id = intval($_GET['sitetemplate_id']);
} else if (exponent_sessions_isset('sitetemplate_id')) {
$id = exponent_sessions_get('sitetemplate_id');
}
$template = $db->selectObject('section_template','id='.$id);
$page = ($template && $template->subtheme != '' && is_readable(BASE.'themes/'.DISPLAY_THEME.'/subthemes/'.$template->subtheme.'.php') ?
'themes/'.DISPLAY_THEME.'/subthemes/'.$template->subtheme.'.php' :
'themes/'.DISPLAY_THEME.'/index.php'
);
$i18n = exponent_lang_loadFile('modules/navigationmodule/actions/edit_page.php');
exponent_sessions_set('themeopt_override',array(
'src_prefix'=>'@st'.$id,
'ignore_mods'=>array(
'navigationmodule',
'loginmodule'
),
'mainpage'=>PATH_RELATIVE.'modules/navigationmodule/actions/edit_page.php',
'backlinktext'=>$i18n['back']
));
#define('PREVIEW_READONLY',1);
$REDIRECTIONPATH = 'section_template';
if ($user && $user->is_acting_admin == 1) {
if (is_readable(BASE.$page)) {
include_once(BASE.$page);
} else {
echo sprintf($i18n['err_not_readable'],BASE.$page);
}
exponent_sessions_unset('themeopt_override');
} else {
echo SITE_403_HTML;
}
?>