Project

General

Profile

« Previous | Next » 

Revision 565

Added by thorn almost 17 years ago

Module menu_link: added dropdown-listbox to select anchor

View differences:

save.php
29 29
$update_when_modified = true; // Tells script to update when this page was last updated
30 30
require(WB_PATH.'/modules/admin.php');
31 31

  
32
// Update id and target
33
if(!isset($_POST['link']))
34
	$foreign_page_id = 0;
35
else
36
	$foreign_page_id = $_POST['link']; // foreign-page_id
32
// Update id, anchor and target
33
if(isset($_POST['page_link'])) {
34
	$foreign_page_id = $_POST['page_link'];
35
	$page_target = $_POST['page_target'];
36
	$url_target = $_POST['target'];
37 37

  
38
$url_target = $_POST['target'];
39
$table_pages = TABLE_PREFIX.'pages';
40
$table_mod = TABLE_PREFIX.'mod_menu_link';
41
$database->query("UPDATE $table_pages SET target = '$url_target' WHERE page_id = '$page_id'");
42
$database->query("UPDATE $table_mod SET target_page_id = '$foreign_page_id' WHERE page_id = '$page_id'");
38
	$table_pages = TABLE_PREFIX.'pages';
39
	$table_mod = TABLE_PREFIX.'mod_menu_link';
40
	$database->query("UPDATE $table_pages SET target = '$url_target' WHERE page_id = '$page_id'");
41
	$database->query("UPDATE $table_mod SET target_page_id = '$foreign_page_id', anchor = '$page_target' WHERE page_id = '$page_id'");
42
}
43 43

  
44 44
// Check if there is a database error, otherwise say successful
45 45
if($database->is_error()) {

Also available in: Unified diff