| 1 |
<?php
|
| 2 |
|
| 3 |
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_links.php,v 1.14.2.4 2006/09/03 16:32:32 ohertel Exp $
|
| 4 |
|
| 5 |
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
|
| 6 |
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
|
| 7 |
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
|
| 8 |
require_once ('tiki-setup.php');
|
| 9 |
|
| 10 |
include_once ('lib/featured_links/flinkslib.php');
|
| 11 |
|
| 12 |
if ($feature_featuredLinks != 'y') {
|
| 13 |
$smarty->assign('msg', tra("This feature is disabled").": feature_featuredLinks");
|
| 14 |
|
| 15 |
$smarty->display("error.tpl");
|
| 16 |
die;
|
| 17 |
}
|
| 18 |
|
| 19 |
// PERMISSIONS: NEEDS p_admin
|
| 20 |
if ($user != 'admin') {
|
| 21 |
if ($tiki_p_admin != 'y') {
|
| 22 |
$smarty->assign('msg', tra("You do not have permission to use this feature"));
|
| 23 |
|
| 24 |
$smarty->display("error.tpl");
|
| 25 |
die;
|
| 26 |
}
|
| 27 |
}
|
| 28 |
|
| 29 |
$smarty->assign('title', '');
|
| 30 |
$smarty->assign('type', 'f');
|
| 31 |
$smarty->assign('position', 1);
|
| 32 |
|
| 33 |
if (isset($_REQUEST["generate"])) {
|
| 34 |
check_ticket('admin-links');
|
| 35 |
$flinkslib->generate_featured_links_positions();
|
| 36 |
}
|
| 37 |
|
| 38 |
if (!isset($_REQUEST["editurl"])) {
|
| 39 |
$_REQUEST["editurl"] = 'n';
|
| 40 |
}
|
| 41 |
|
| 42 |
if ($_REQUEST["editurl"] != 'n') {
|
| 43 |
$info = $flinkslib->get_featured_link($_REQUEST["editurl"]);
|
| 44 |
|
| 45 |
if (!$info) {
|
| 46 |
$smarty->assign('msg', tra("Non-existent link"));
|
| 47 |
|
| 48 |
$smarty->display("error.tpl");
|
| 49 |
die;
|
| 50 |
}
|
| 51 |
|
| 52 |
$smarty->assign('title', $info["title"]);
|
| 53 |
$smarty->assign('position', $info["position"]);
|
| 54 |
$smarty->assign('type', $info["type"]);
|
| 55 |
}
|
| 56 |
|
| 57 |
$smarty->assign('editurl', $_REQUEST["editurl"]);
|
| 58 |
|
| 59 |
if (isset($_REQUEST["add"])) {
|
| 60 |
check_ticket('admin-links');
|
| 61 |
if (!empty($_REQUEST["url"]) && !empty($_REQUEST["url"])) {
|
| 62 |
if ($_REQUEST["editurl"] == 0) {
|
| 63 |
$flinkslib->add_featured_link($_REQUEST["url"], $_REQUEST["title"], '', $_REQUEST["position"], $_REQUEST["type"]);
|
| 64 |
} else {
|
| 65 |
$flinkslib->update_featured_link($_REQUEST["url"], $_REQUEST["$title"], '', $_REQUEST["position"], $_REQUEST["type"]);
|
| 66 |
}
|
| 67 |
}
|
| 68 |
}
|
| 69 |
|
| 70 |
if (isset($_REQUEST["remove"])) {
|
| 71 |
$area = 'delfeaturedlink';
|
| 72 |
if ($feature_ticketlib2 != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
|
| 73 |
key_check($area);
|
| 74 |
$flinkslib->remove_featured_link($_REQUEST["remove"]);
|
| 75 |
} else {
|
| 76 |
key_get($area);
|
| 77 |
}
|
| 78 |
}
|
| 79 |
|
| 80 |
$links = $tikilib->get_featured_links(999999);
|
| 81 |
$smarty->assign_by_ref('links', $links);
|
| 82 |
ask_ticket('admin-links');
|
| 83 |
|
| 84 |
// disallow robots to index page:
|
| 85 |
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
|
| 86 |
|
| 87 |
$smarty->assign('mid', 'tiki-admin_links.tpl');
|
| 88 |
$smarty->display("tiki.tpl");
|
| 89 |
|
| 90 |
?>
|