-
Notifications
You must be signed in to change notification settings - Fork 3
/
editor.admin.php
113 lines (98 loc) · 3.5 KB
/
editor.admin.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
//This is a module for pluck, an opensource content management system
//Website: http://www.pluck-cms.org
//Make sure the file isn't accessed directly
defined('IN_PLUCK') or exit('Access denied!');
function read_style($theme) {
return file_get_contents('data/themes/' . $theme . '/style.css');
}
function read_themes($theme) {
return file_get_contents('data/themes/' . $theme . '/theme.php');
}
function save_style($theme, $content) {
$file = fopen('data/themes/' . $theme . '/style.css', 'w');
$content = stripslashes($content);
fputs($file, $content);
fclose($file);
}
function save_themes($theme, $content) {
$file = fopen('data/themes/' . $theme . '/theme.php', 'w');
$content = stripslashes($content);
fputs($file, $content);
fclose($file);
}
function editor_pages_admin() {
global $lang;
$module_page_admin[] = array(
'func' => 'Main',
'title' => $lang['editor']['main']
);
$module_page_admin[] = array(
'func' => 'Theme',
'title' => $lang['editor']['theme']
);
$module_page_admin[] = array(
'func' => 'CSS',
'title' => $lang['editor']['css']
);
$module_page_admin[] = array(
'func' => 'Info',
'title' => $lang['editor']['info']
);
return $module_page_admin;
}
function editor_page_admin_Main() {
global $lang;
showmenudiv($lang['editor']['edit_css'],$lang['editor']['edit_css_info'],'data/modules/editor/images/css.png','admin.php?module=editor&page=CSS',false);
showmenudiv($lang['editor']['edit_theme'],$lang['editor']['edit_theme_info'],'data/modules/editor/images/theme.png','admin.php?module=editor&page=Theme',false);
showmenudiv($lang['editor']['edit_info'],$lang['editor']['edit_info_info'],'data/modules/editor/images/theme.png','admin.php?module=editor&page=Info',false);
}
function editor_page_admin_Theme() {
//Allow module to manipulate theme
$page_theme = THEME;
run_hook('site_theme', array(&$page_theme));
global $lang, $cont1;
?>
<form method="post" action="">
<label class="kop2" for="cont1"><?php echo $lang['editor']['content_theme']; ?></label>
<br />
<textarea name="cont1" id="cont1" cols="90" rows="20"><?php echo read_themes($page_theme); ?></textarea>
<br />
<input type="submit" name="Submit" value="<?php echo $lang['general']['save']; ?>" />
<input type="button" name="Cancel" value="<?php echo $lang['general']['cancel']; ?>" onclick="javascript: window.location='admin.php?module=editor';" />
</form>
<?php
//Save style.
if (isset($_POST['Submit'])) {
save_themes($page_theme, $cont1);
redirect('admin.php?module=editor', 0);
}
}
function editor_page_admin_CSS() {
//Allow module to manipulate css
$page_theme = THEME;
run_hook('site_theme', array(&$page_theme));
global $lang, $cont1;
?>
<form method="post" action="">
<label class="kop2" for="cont1"><?php echo $lang['editor']['content_css']; ?></label>
<br />
<textarea name="cont1" id="cont1" cols="90" rows="20"><?php echo read_style($page_theme); ?></textarea>
<br />
<input type="submit" name="Submit" value="<?php echo $lang['general']['save']; ?>" />
<input type="button" name="Cancel" value="<?php echo $lang['general']['cancel']; ?>" onclick="javascript: window.location='admin.php?module=editor';" />
</form>
<?php
//Save style.
if (isset($_POST['Submit'])) {
save_style($page_theme, $cont1);
redirect('admin.php?module=editor', 0);
}
}
function editor_page_admin_Info() {
global $lang;
echo '<p><a href="?module=editor"><<< '.$lang['general']['back'].'</a></p>';
phpinfo();
echo '<p><a href="?module=editor"><<< '.$lang['general']['back'].'</a></p>';
}
?>