forked from d3m3vilurr/soojung
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bookmark.php
39 lines (33 loc) · 976 Bytes
/
bookmark.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
<?php
session_start();
include("settings.php");
if (!isset($_SESSION["auth"])) {
echo "<meta http-equiv='refresh' content='0;URL=admin.php'>";
exit;
}
/* for posting new bookmark */
if ($_POST["mode"] == "delete") {
$del_list = $_POST["delchk"];
foreach($del_list as $number => $chk) {
Bookmark::deleteBookmark($number);
}
} else if ($_GET["mode"] == "delete") {
$number = $_GET["number"];
Bookmark::deleteBookmark($number);
} else if ($_GET["mode"] == "move") {
$number = $_GET["number"];
$offset = intval($_GET["offset"]);
Bookmark::moveBookmark($number, $offset);
/* XXX without refresh moving, file doesnt save correctly */
echo "<meta http-equiv='refresh' content='0;URL=bookmark.php'>";
exit;
}
$template = new AdminTemplate;
$bookmarks = Bookmark::getBookmarkList();
if (empty($bookmarks)) {
$bookmarks = array();
}
$template->assign('bookmarks', $bookmarks);
$template->display('bookmark.tpl');
# vim: ts=8 sw=2 sts=2 noet
?>