Revision 543
Added by thorn almost 17 years ago
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 |
$database = new database(); |
|
33 |
|
|
34 | 32 |
// Update the mod_menu_links table with the link |
35 |
if(isset($_POST['link'])) { |
|
36 |
// Update link and target |
|
37 |
$link = $admin->add_slashes($_POST['link']); |
|
38 |
$target = $_POST['target']; |
|
39 |
$query = "UPDATE ".TABLE_PREFIX."pages SET link = '$link', target = '$target' WHERE page_id = '$page_id'"; |
|
40 |
$database->query($query); |
|
33 |
if(isset($_POST['link']) && isset($_POST['target'])) { |
|
34 |
// Update id and target |
|
35 |
$foreign_page_id = $_POST['link']; // foreign-page_id |
|
36 |
$url_target = $_POST['target']; |
|
37 |
$table_pages = TABLE_PREFIX.'pages'; |
|
38 |
$table_mod = TABLE_PREFIX.'mod_menu_link'; |
|
39 |
$database->query("UPDATE $table_pages SET target = '$url_target' WHERE page_id = '$page_id'"); |
|
40 |
$database->query("UPDATE $table_mod SET target_page_id = '$foreign_page_id' WHERE page_id = '$page_id'"); |
|
41 | 41 |
} else { |
42 |
$admin->print_error('Error in wb/modules/menu_link/save.php at line 35', $js_back);
|
|
42 |
$admin->print_error('Error in wb/modules/menu_link/save.php at line 35', true);
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
// Check if there is a database error, otherwise say successful |
... | ... | |
52 | 52 |
// Print admin footer |
53 | 53 |
$admin->print_footer(); |
54 | 54 |
|
55 |
?> |
|
55 |
?> |
Also available in: Unified diff
module menu_link: fixed page-deleteing-bug and some odd behavior, added table mod_menu_link