Project

General

Profile

1 1425 Luisehahne
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         menu_link
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
*/
18
19
require_once('../../config.php');
20
21 1457 Luisehahne
$admin_header = false;
22
// Tells script to update when this page was last updated
23
$update_when_modified = true;
24 1425 Luisehahne
// Include WB admin wrapper script
25
require(WB_PATH.'/modules/admin.php');
26 1473 Luisehahne
$backlink = ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id;
27 1425 Luisehahne
if (!$admin->checkFTAN())
28
{
29 1457 Luisehahne
	$admin->print_header();
30 1473 Luisehahne
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink );
31 1425 Luisehahne
}
32 1457 Luisehahne
$admin->print_header();
33 1425 Luisehahne
34
// Update id, anchor and target
35
if(isset($_POST['menu_link'])) {
36
	$foreign_page_id = $admin->add_slashes($_POST['menu_link']);
37
	$page_target = $admin->add_slashes($_POST['page_target']);
38
	$url_target = $admin->add_slashes($_POST['target']);
39
	$r_type = $admin->add_slashes($_POST['r_type']);
40
	if(isset($_POST['extern']))
41
		$extern = $admin->add_slashes($_POST['extern']);
42
	else
43
		$extern='';
44
45
	$table_pages = TABLE_PREFIX.'pages';
46
	$table_mod = TABLE_PREFIX.'mod_menu_link';
47
	$database->query("UPDATE `$table_pages` SET `target` = '$url_target' WHERE `page_id` = '$page_id'");
48
	$database->query("UPDATE `$table_mod` SET `target_page_id` = '$foreign_page_id', `anchor` = '$page_target', `extern` = '$extern', `redirect_type` = '$r_type' WHERE `page_id` = '$page_id'");
49
}
50
51
// Check if there is a database error, otherwise say successful
52
if($database->is_error()) {
53
	$admin->print_error($database->get_error(), $js_back);
54
} else {
55 1473 Luisehahne
	$admin->print_success($MESSAGE['PAGES']['SAVED'],$backlink );
56 1425 Luisehahne
}
57
58
// Print admin footer
59
$admin->print_footer();
60
61 545 thorn
?>