This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
modify.php
139 lines (114 loc) · 5.41 KB
/
modify.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/*
Website Baker Project <http://www.websitebaker.org/>
Copyright (C) 2004-2008, Ryan Djurovich
Website Baker 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.
Website Baker 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 Website Baker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// prevent this file from being accessed directly
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
// check if backend.css file needs to be included into <body></body>
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/foldergallery/backend.css")) {
echo '<style type="text/css">';
include(WB_PATH .'/modules/foldergallery/backend.css');
echo "\n</style>\n";
}
// include the default language
require_once(WB_PATH .'/modules/foldergallery/languages/EN.php');
// check if module language file exists for the language set by the user (e.g. DE, EN)
if(file_exists(WB_PATH .'/modules/foldergallery/languages/'.LANGUAGE .'.php')) {
require_once(WB_PATH .'/modules/foldergallery/languages/'.LANGUAGE .'.php');
}
// Files includen
require_once (WB_PATH.'/modules/foldergallery/info.php');
require_once (WB_PATH.'/modules/foldergallery/admin/scripts/backend.functions.php');
// Set the mySQL encoding to utf8
$oldMysqlEncoding = mysql_client_encoding();
mysql_set_charset('utf8',$database->db_handle);
// Einstellungen zur aktuellen Foldergallery aus der DB
$settings = getSettings($section_id);
// Falls noch keine Einstellungen gemacht wurden auf die Einstellungsseite umleiten
if($settings['root_dir'] == 'd41d8cd98f00b204e9800998ecf8427e') {
?>
<script language="javascript">
function Weiterleitung() {
location.href= '<?php echo WB_URL; ?>/modules/foldergallery/admin/modify_settings.php?page_id=<?php echo $page_id; ?>§ion_id=<?php echo $section_id; ?>';
}
window.setTimeout("Weiterleitung()", 2000); // in msecs 1000 => eine Sekunde
</script>
<?php
echo "<div class=\"info\">".$MOD_FOLDERGALLERY['REDIRECT']."\n</div>\n";
} else {
// Template
$t = new Template(dirname(__FILE__).'/admin/templates', 'remove');
$t->halt_on_error = 'no';
$t->set_file('modify', 'modify.htt');
// clear the comment-block, if present
$t->set_block('modify', 'CommentDoc'); $t->clear_var('CommentDoc');
$t->set_block('modify', 'ListElement', 'LISTELEMENT');
$t->clear_var('ListElement'); // Löschen, da dies über untenstehende Funktion erledigt wird.
// Links im Template setzen
$t->set_var(array(
'SETTINGS_ONCLICK' => 'javascript: window.location = \''.WB_URL.'/modules/foldergallery/admin/modify_settings.php?page_id='.$page_id.'&section_id='.$section_id.'\';',
'SYNC_ONKLICK' => 'javascript: window.location = \''.WB_URL.'/modules/foldergallery/admin/sync.php?page_id='.$page_id.'&section_id='.$section_id.'\';',
'HELP_ONCLICK' => 'javascript: window.location = \''.WB_URL.'/modules/foldergallery/help.php?page_id='.$page_id.'&section_id='.$section_id.'\';',
'NEW_CAT_ONCLICK' => 'javascript: window.location = \''.WB_URL.'/modules/foldergallery/admin/new_cat.php?page_id='.$page_id.'&section_id='.$section_id.'\';',
'EDIT_PAGE' => $page_id,
'EDIT_SECTION' => $section_id,
'WB_URL' => WB_URL
));
// Text im Template setzten
$t->set_var(array(
'TITEL_BACKEND_STRING' => $MOD_FOLDERGALLERY['TITEL_BACKEND'],
'TITEL_MODIFY' => $MOD_FOLDERGALLERY['TITEL_MODIFY'],
'SETTINGS_STRING' => $MOD_FOLDERGALLERY['SETTINGS'],
'FOLDER_IN_FS_STRING' => $MOD_FOLDERGALLERY['FOLDER_IN_FS'],
'CAT_TITLE_STRING' => $MOD_FOLDERGALLERY['CAT_TITLE'],
'ACTIONS_STRING' => $MOD_FOLDERGALLERY['ACTION'],
'SYNC_STRING' => $MOD_FOLDERGALLERY['SYNC'],
'EDIT_CSS_STRING' => $MOD_FOLDERGALLERY['EDIT_CSS'],
'EXPAND_COLAPSE_STRING' => $MOD_FOLDERGALLERY['EXPAND_COLAPSE'],
'HELP_STRING' => $MOD_FOLDERGALLERY['HELP_INFORMATION'],
'NEW_CAT_STRING' => $MOD_FOLDERGALLERY['NEW_CAT']
));
// Template ausgeben
$t->pparse('output', 'modify');
// Kategorien von der obersten Ebene aus DB hohlen
$sql = "SELECT * FROM ".TABLE_PREFIX."mod_foldergallery_categories WHERE section_id=".$section_id." AND niveau=0;";
$query = $database->query($sql);
while($result = $query->fetchRow()){
$results[] = $result;
}
// Needed for display_categories()
$url = array(
'edit' => WB_URL."/modules/foldergallery/admin/modify_cat.php?page_id=".$page_id."§ion_id=".$section_id."&cat_id=",
);
echo '<script type="text/javascript">
var the_parent_id = "0";
var theme_url = "'.THEME_URL.'";
var fg_url = "'.WB_URL.'/modules/foldergallery";
</script>
<ul>
'.display_categories(-1, $section_id).'
</ul>
<div id="dragableCategorie">
<ul>
'.display_categories(0, $section_id).'
</ul>
</div>
<div style="display: block; width: 90%; height: 15px; padding: 5px;"><div id="dragableResult"> </div></div><hr>
';
// Schluss vom else Teil ganz oben!
}
// reset the mySQL encoding
mysql_set_charset($oldMysqlEncoding, $database->db_handle);
?>