change the menu/menu_item_edit.php back button to use a link rather than history. When assigning a group enable the ability for it to be done at the same time the menu is created.
This commit is contained in:
parent
7db96747c9
commit
a1a2e60303
|
|
@ -60,26 +60,6 @@ else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add a group to the menu
|
|
||||||
if ($_REQUEST["a"] != "delete" && strlen($group_name) > 0 && permission_exists('menu_add')) {
|
|
||||||
//add the group to the menu
|
|
||||||
if (strlen($menu_item_uuid) > 0) {
|
|
||||||
$sql_insert = "insert into v_menu_item_groups ";
|
|
||||||
$sql_insert .= "(";
|
|
||||||
$sql_insert .= "menu_uuid, ";
|
|
||||||
$sql_insert .= "menu_item_uuid, ";
|
|
||||||
$sql_insert .= "group_name ";
|
|
||||||
$sql_insert .= ")";
|
|
||||||
$sql_insert .= "values ";
|
|
||||||
$sql_insert .= "(";
|
|
||||||
$sql_insert .= "'".$menu_uuid."', ";
|
|
||||||
$sql_insert .= "'".$menu_item_uuid."', ";
|
|
||||||
$sql_insert .= "'".$group_name."' ";
|
|
||||||
$sql_insert .= ")";
|
|
||||||
$db->exec($sql_insert);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//action add or update
|
//action add or update
|
||||||
if (isset($_REQUEST["menu_item_uuid"])) {
|
if (isset($_REQUEST["menu_item_uuid"])) {
|
||||||
if (strlen($_REQUEST["menu_item_uuid"]) > 0) {
|
if (strlen($_REQUEST["menu_item_uuid"]) > 0) {
|
||||||
|
|
@ -138,6 +118,7 @@ else {
|
||||||
|
|
||||||
//add or update the database
|
//add or update the database
|
||||||
if ($_POST["persistformvar"] != "true") {
|
if ($_POST["persistformvar"] != "true") {
|
||||||
|
//add a menu item
|
||||||
if ($action == "add" && permission_exists('menu_add')) {
|
if ($action == "add" && permission_exists('menu_add')) {
|
||||||
$sql = "SELECT menu_item_order FROM v_menu_items ";
|
$sql = "SELECT menu_item_order FROM v_menu_items ";
|
||||||
$sql .= "where menu_uuid = '$menu_uuid' ";
|
$sql .= "where menu_uuid = '$menu_uuid' ";
|
||||||
|
|
@ -152,6 +133,7 @@ else {
|
||||||
}
|
}
|
||||||
unset($prep_statement);
|
unset($prep_statement);
|
||||||
|
|
||||||
|
$menu_item_uuid = uuid();
|
||||||
$sql = "insert into v_menu_items ";
|
$sql = "insert into v_menu_items ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
$sql .= "menu_uuid, ";
|
$sql .= "menu_uuid, ";
|
||||||
|
|
@ -174,7 +156,7 @@ else {
|
||||||
$sql .= "'$menu_item_category', ";
|
$sql .= "'$menu_item_category', ";
|
||||||
$sql .= "'$menu_item_description', ";
|
$sql .= "'$menu_item_description', ";
|
||||||
$sql .= "'$menu_item_protected', ";
|
$sql .= "'$menu_item_protected', ";
|
||||||
$sql .= "'".uuid()."', ";
|
$sql .= "'".$menu_item_uuid."', ";
|
||||||
if (strlen($menu_item_parent_uuid) == 0) {
|
if (strlen($menu_item_parent_uuid) == 0) {
|
||||||
$sql .= "null, ";
|
$sql .= "null, ";
|
||||||
}
|
}
|
||||||
|
|
@ -187,16 +169,9 @@ else {
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
require_once "includes/header.php";
|
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=menu_item_edit.php?id=$menu_uuid&menu_item_uuid=$menu_item_uuid&menu_uuid=$menu_uuid\">\n";
|
|
||||||
echo "<div align='center'>\n";
|
|
||||||
echo "Add Complete\n";
|
|
||||||
echo "</div>\n";
|
|
||||||
require_once "includes/footer.php";
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//update the menu item
|
||||||
if ($action == "update" && permission_exists('menu_edit')) {
|
if ($action == "update" && permission_exists('menu_edit')) {
|
||||||
$sql = "update v_menu_items set ";
|
$sql = "update v_menu_items set ";
|
||||||
$sql .= "menu_item_title = '$menu_item_title', ";
|
$sql .= "menu_item_title = '$menu_item_title', ";
|
||||||
|
|
@ -216,15 +191,41 @@ else {
|
||||||
$sql .= "where menu_uuid = '$menu_uuid' ";
|
$sql .= "where menu_uuid = '$menu_uuid' ";
|
||||||
$sql .= "and menu_item_uuid = '$menu_item_uuid' ";
|
$sql .= "and menu_item_uuid = '$menu_item_uuid' ";
|
||||||
$count = $db->exec(check_sql($sql));
|
$count = $db->exec(check_sql($sql));
|
||||||
|
}
|
||||||
|
|
||||||
|
//add a group to the menu
|
||||||
|
if ($_REQUEST["a"] != "delete" && strlen($group_name) > 0 && permission_exists('menu_add')) {
|
||||||
|
//add the group to the menu
|
||||||
|
if (strlen($menu_item_uuid) > 0) {
|
||||||
|
$sql_insert = "insert into v_menu_item_groups ";
|
||||||
|
$sql_insert .= "(";
|
||||||
|
$sql_insert .= "menu_uuid, ";
|
||||||
|
$sql_insert .= "menu_item_uuid, ";
|
||||||
|
$sql_insert .= "group_name ";
|
||||||
|
$sql_insert .= ")";
|
||||||
|
$sql_insert .= "values ";
|
||||||
|
$sql_insert .= "(";
|
||||||
|
$sql_insert .= "'".$menu_uuid."', ";
|
||||||
|
$sql_insert .= "'".$menu_item_uuid."', ";
|
||||||
|
$sql_insert .= "'".$group_name."' ";
|
||||||
|
$sql_insert .= ")";
|
||||||
|
$db->exec($sql_insert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//redirect the user
|
||||||
require_once "includes/header.php";
|
require_once "includes/header.php";
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=menu_item_edit.php?id=$menu_uuid&menu_item_uuid=$menu_item_uuid&menu_uuid=$menu_uuid\">\n";
|
echo "<meta http-equiv=\"refresh\" content=\"2;url=menu_item_edit.php?id=$menu_uuid&menu_item_uuid=$menu_item_uuid&menu_uuid=$menu_uuid\">\n";
|
||||||
echo "<div align='center'>\n";
|
echo "<div align='center'>\n";
|
||||||
|
if ($action == "add") {
|
||||||
|
echo "Add Complete\n";
|
||||||
|
}
|
||||||
|
if ($action == "update") {
|
||||||
echo "Edit Complete\n";
|
echo "Edit Complete\n";
|
||||||
|
}
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
require_once "includes/footer.php";
|
require_once "includes/footer.php";
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
} //if ($_POST["persistformvar"] != "true")
|
} //if ($_POST["persistformvar"] != "true")
|
||||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||||
|
|
||||||
|
|
@ -267,10 +268,9 @@ else {
|
||||||
|
|
||||||
echo "<form method='post' action=''>";
|
echo "<form method='post' action=''>";
|
||||||
echo "<table width='100%' cellpadding='6' cellspacing='0'>";
|
echo "<table width='100%' cellpadding='6' cellspacing='0'>";
|
||||||
|
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td width='30%' align='left' valign='top' nowrap><b>Menu Item Edit</b></td>\n";
|
echo "<td width='30%' align='left' valign='top' nowrap><b>Menu Item Edit</b></td>\n";
|
||||||
echo "<td width='70%' align='right' valign='top'><input type='button' class='btn' name='' alt='back' onclick=\"window.history.back();\" value='Back'><br /><br /></td>\n";
|
echo "<td width='70%' align='right' valign='top'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='menu_edit.php?id=".$menu_uuid."\" value='Back'><br /><br /></td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
echo " <tr>";
|
echo " <tr>";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue