blob: cb2ff169a7ba55bf191eb2b5446c20cae452205c (
plain)
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
require_once('utils.php');
need_auth();
// Config loading
$site_conf = load_ini_site_conf("content/site_conf.ini");
if ( ! is_array($site_conf) ) trigger_error("Error parsing site_conf.ini", E_USER_ERROR);
// Localization Init
l10n_init($site_conf['site_admin_lang']);
// URL parameter parsing
$kind = sanitize($_GET, 'kind', RE_IDENTIFIER_CLEANER, 'page'); /* Could be : page, media */
// Pre-computed because used twice
$page_title = _('Admin') . ' - ' . ( ($kind=='media')?_('Add a media'):_('Add a page') );
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="treeview.css">
<link rel="stylesheet" href="admin.css">
<script type="text/javascript" src="admin.js"></script>
<title><?=$page_title?></title>
</head>
<body>
<h1><?=$page_title?></h1>
<form>
<fieldset>
<legend><?=($kind=='media')?_('Media tree'):_('Page tree')?></legend>
<div class="css-treeview">
<?php
if ($kind=='media') {
$tree=find_all('../media', 'media');
} else {
$tree=find_all('./content', 'page');
}
php_array_to_tree($tree, 'select_fold');
?>
</div>
</fieldset>
<fieldset>
<legend><?=_('Selected folder')?></legend>
<label for="fold_path"><?=_('Folder path')?></label>
<input id="fold_path" name="fold_path" readonly="readonly" value="<?=_('(choose a folder in the tree)')?>"><br>
<label for="fold_add_name"><?=_('New item name')?></label>
<input id="fold_add_name" type="text" value="">
<label for="fold_add_fold"><?=_('Actions')?></label>
<input id="fold_add_fold" type="button" value="<?=_('Add folder')?>" onclick="go_add('<?=$kind?>','fold');">
<input id="fold_add_item" type="button" value="<?=_('Add page')?>" onclick="go_add('<?=$kind?>','item');">
</fieldset>
<input id="fold_back_admin" type="button" value="<?=_('Back to admin')?>" onclick="go_admin_page();">
</form>
</body>
</html>
|