mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
menu_item_protected deprecated
This protected feature has not been working correctly. At the moment commented out depending on feedback it maybe removed entirely.
This commit is contained in:
@@ -193,10 +193,10 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = "true";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_protected";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
//$apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_protected";
|
||||
//$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
//$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_order";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
$menu_item_icon = '';
|
||||
$menu_item_icon_color = '';
|
||||
$menu_item_description = '';
|
||||
$menu_item_protected = '';
|
||||
//$menu_item_protected = '';
|
||||
$menu_item_parent_uuid = null;
|
||||
$menu_item_order = null;
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
$menu_item_icon = $_POST["menu_item_icon"] ?? '';
|
||||
$menu_item_icon_color = $_POST["menu_item_icon_color"] ?? '';
|
||||
$menu_item_description = $_POST["menu_item_description"] ?? '';
|
||||
$menu_item_protected = $_POST["menu_item_protected"] ?? '';
|
||||
//$menu_item_protected = $_POST["menu_item_protected"] ?? '';
|
||||
$menu_item_parent_uuid = $_POST["menu_item_parent_uuid"] ?? null;
|
||||
$menu_item_order = $_POST["menu_item_order"] ?? '';
|
||||
}
|
||||
@@ -177,7 +177,7 @@
|
||||
$array['menu_items'][0]['menu_item_icon'] = $menu_item_icon;
|
||||
$array['menu_items'][0]['menu_item_icon_color'] = $menu_item_icon_color;
|
||||
$array['menu_items'][0]['menu_item_description'] = $menu_item_description;
|
||||
$array['menu_items'][0]['menu_item_protected'] = $menu_item_protected;
|
||||
//$array['menu_items'][0]['menu_item_protected'] = $menu_item_protected;
|
||||
$array['menu_items'][0]['menu_item_uuid'] = $menu_item_uuid;
|
||||
if (!is_uuid($menu_item_parent_uuid)) {
|
||||
$array['menu_items'][0]['menu_item_parent_uuid'] = null;
|
||||
@@ -203,7 +203,7 @@
|
||||
$array['menu_items'][0]['menu_item_icon'] = $menu_item_icon;
|
||||
$array['menu_items'][0]['menu_item_icon_color'] = $menu_item_icon_color;
|
||||
$array['menu_items'][0]['menu_item_description'] = $menu_item_description;
|
||||
$array['menu_items'][0]['menu_item_protected'] = $menu_item_protected;
|
||||
//$array['menu_items'][0]['menu_item_protected'] = $menu_item_protected;
|
||||
$array['menu_items'][0]['menu_item_uuid'] = $menu_item_uuid;
|
||||
if (!is_uuid($menu_item_parent_uuid)) {
|
||||
$array['menu_items'][0]['menu_item_parent_uuid'] = null;
|
||||
@@ -221,13 +221,13 @@
|
||||
}
|
||||
|
||||
//update child menu items to protected true or false
|
||||
$sql = "update v_menu_items ";
|
||||
$sql .= "set menu_item_protected = :menu_item_protected ";
|
||||
$sql .= "where menu_item_parent_uuid = :menu_item_parent_uuid ";
|
||||
$parameters['menu_item_parent_uuid'] = $menu_item_uuid;
|
||||
$parameters['menu_item_protected'] = $menu_item_protected;
|
||||
$database->execute($sql, $parameters);
|
||||
unset($parameters);
|
||||
//$sql = "update v_menu_items ";
|
||||
//$sql .= "set menu_item_protected = :menu_item_protected ";
|
||||
//$sql .= "where menu_item_parent_uuid = :menu_item_parent_uuid ";
|
||||
//$parameters['menu_item_parent_uuid'] = $menu_item_uuid;
|
||||
//$parameters['menu_item_protected'] = $menu_item_protected;
|
||||
//$database->execute($sql, $parameters);
|
||||
//unset($parameters);
|
||||
|
||||
//add a group to the menu
|
||||
if (!empty($group_uuid_name) && permission_exists('menu_add')) {
|
||||
@@ -319,7 +319,7 @@
|
||||
$menu_item_icon = $row["menu_item_icon"];
|
||||
$menu_item_icon_color = $row["menu_item_icon_color"];
|
||||
$menu_item_description = $row["menu_item_description"];
|
||||
$menu_item_protected = $row["menu_item_protected"];
|
||||
//$menu_item_protected = $row["menu_item_protected"];
|
||||
$menu_item_parent_uuid = $row["menu_item_parent_uuid"];
|
||||
$menu_item_order = $row["menu_item_order"];
|
||||
$menu_item_add_user = $row["menu_item_add_user"];
|
||||
@@ -535,29 +535,29 @@
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-protected']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='menu_item_protected'>\n";
|
||||
if ($menu_item_protected == "false") {
|
||||
echo " <option value='false' selected='selected' >".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
if ($menu_item_protected == "true") {
|
||||
echo " <option value='true' selected='selected' >".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
echo " </select><br />\n";
|
||||
echo $text['description-protected']."<br />\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
//echo "<tr>\n";
|
||||
//echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
//echo " ".$text['label-protected']."\n";
|
||||
//echo "</td>\n";
|
||||
//echo "<td class='vtable' align='left'>\n";
|
||||
//echo " <select class='formfld' name='menu_item_protected'>\n";
|
||||
//if ($menu_item_protected == "false") {
|
||||
// echo " <option value='false' selected='selected' >".$text['label-false']."</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
//}
|
||||
//if ($menu_item_protected == "true") {
|
||||
// echo " <option value='true' selected='selected' >".$text['label-true']."</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
//}
|
||||
//echo " </select><br />\n";
|
||||
//echo $text['description-protected']."<br />\n";
|
||||
//echo "\n";
|
||||
//echo "</td>\n";
|
||||
//echo "</tr>\n";
|
||||
|
||||
if (!empty($action) && $action == "update") {
|
||||
if (empty($menu_item_parent_uuid)) {
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
//set the db values as php variables
|
||||
$menu_item_uuid = $row2['menu_item_uuid'];
|
||||
$menu_item_category = $row2['menu_item_category'];
|
||||
$menu_item_protected = $row2['menu_item_protected'];
|
||||
//$menu_item_protected = $row2['menu_item_protected'];
|
||||
$menu_item_parent_uuid = $row2['menu_item_parent_uuid'];
|
||||
$menu_item_order = $row2['menu_item_order'];
|
||||
$menu_item_title = $row2['menu_item_title'];
|
||||
@@ -187,15 +187,15 @@
|
||||
echo "<td class='no-wrap overflow no-link hide-sm-dn'>".$menu_item_link." </td>\n";
|
||||
echo "<td class='no-wrap overflow hide-xs'>".$group_list." </td>";
|
||||
echo "<td class='center'>".$menu_item_category." </td>";
|
||||
if (permission_exists('menu_item_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')];
|
||||
}
|
||||
echo " </td>\n";
|
||||
//if (permission_exists('menu_item_edit')) {
|
||||
// echo " <td class='no-link center'>\n";
|
||||
// echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
//}
|
||||
//else {
|
||||
// echo " <td class='center'>\n";
|
||||
// echo $text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')];
|
||||
//}
|
||||
//echo " </td>\n";
|
||||
echo "<td class='center no-wrap'> </td>";
|
||||
|
||||
//echo "<td align='center'>";
|
||||
@@ -313,7 +313,7 @@
|
||||
echo " <th class='no-wrap pct-35 hide-sm-dn'>".$text['label-link']."</th>";
|
||||
echo " <th class='no-wrap pct-35 hide-xs'>".$text['label-groups']."</th>";
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-category']."</th>";
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-protected']."</th>";
|
||||
//echo " <th class='no-wrap center shrink'>".$text['label-protected']."</th>";
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-menu_order']."</th>";
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
@@ -330,7 +330,7 @@
|
||||
$menu_item_link = $row['menu_item_link'];
|
||||
$menu_item_icon = $row['menu_item_icon'];
|
||||
$menu_item_icon_color = $row['menu_item_icon_color'];
|
||||
$menu_item_protected = $row['menu_item_protected'];
|
||||
//$menu_item_protected = $row['menu_item_protected'];
|
||||
|
||||
//get the groups that have been assigned to the menu
|
||||
$sql = "select ";
|
||||
@@ -399,15 +399,15 @@
|
||||
echo "<td class='no-wrap overflow no-link hide-sm-dn'>".$menu_item_link." </td>\n";
|
||||
echo "<td class='no-wrap overflow hide-xs'>".($group_list ?? '')." </td>\n";
|
||||
echo "<td class='center'>".$menu_item_category." </td>\n";
|
||||
if (permission_exists('menu_item_edit')) {
|
||||
echo "<td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo "<td class='center'>\n";
|
||||
echo $text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')];
|
||||
}
|
||||
echo "</td>\n";
|
||||
//if (permission_exists('menu_item_edit')) {
|
||||
// echo "<td class='no-link center'>\n";
|
||||
// echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
//}
|
||||
//else {
|
||||
// echo "<td class='center'>\n";
|
||||
// echo $text['label-'.($menu_item_protected == 'true' ? 'true' : 'false')];
|
||||
//}
|
||||
//echo "</td>\n";
|
||||
echo "<td class='center'>".$row['menu_item_order']." </td>\n";
|
||||
|
||||
//echo "<td align='center' nowrap>";
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
$menu = new menu;
|
||||
$menu->menu_uuid = $menu_uuid;
|
||||
$menu->menu_language = $menu_language;
|
||||
$menu->delete_unprotected();
|
||||
$menu->delete();
|
||||
$menu->restore();
|
||||
unset($menu);
|
||||
|
||||
|
||||
@@ -315,9 +315,9 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* delete items in the menu that are not protected
|
||||
* delete items in the menu
|
||||
*/
|
||||
public function delete_unprotected() {
|
||||
public function delete() {
|
||||
//remove existing menu languages
|
||||
$sql = "delete from v_menu_languages ";
|
||||
$sql .= "where menu_uuid = :menu_uuid ";
|
||||
@@ -325,38 +325,38 @@
|
||||
$sql .= " select menu_item_uuid ";
|
||||
$sql .= " from v_menu_items ";
|
||||
$sql .= " where menu_uuid = :menu_uuid ";
|
||||
$sql .= " and ( ";
|
||||
$sql .= " menu_item_protected <> 'true' ";
|
||||
$sql .= " or menu_item_protected is null ";
|
||||
$sql .= " ) ";
|
||||
//$sql .= " and ( ";
|
||||
//$sql .= " menu_item_protected <> 'true' ";
|
||||
//$sql .= " or menu_item_protected is null ";
|
||||
//$sql .= " ) ";
|
||||
$sql .= ") ";
|
||||
$parameters['menu_uuid'] = $this->menu_uuid;
|
||||
$this->database->execute($sql, $parameters);
|
||||
unset($sql, $parameters);
|
||||
|
||||
//remove existing unprotected menu item groups
|
||||
//remove existing menu item groups
|
||||
$sql = "delete from v_menu_item_groups ";
|
||||
$sql .= "where menu_uuid = :menu_uuid ";
|
||||
$sql .= "and menu_item_uuid in ( ";
|
||||
$sql .= " select menu_item_uuid ";
|
||||
$sql .= " from v_menu_items ";
|
||||
$sql .= " where menu_uuid = :menu_uuid ";
|
||||
$sql .= " and ( ";
|
||||
$sql .= " menu_item_protected <> 'true' ";
|
||||
$sql .= " or menu_item_protected is null ";
|
||||
$sql .= " ) ";
|
||||
//$sql .= " and ( ";
|
||||
//$sql .= " menu_item_protected <> 'true' ";
|
||||
//$sql .= " or menu_item_protected is null ";
|
||||
//$sql .= " ) ";
|
||||
$sql .= ") ";
|
||||
$parameters['menu_uuid'] = $this->menu_uuid;
|
||||
$this->database->execute($sql, $parameters);
|
||||
unset($sql, $parameters);
|
||||
|
||||
//remove existing unprotected menu items
|
||||
//remove existing menu items
|
||||
$sql = "delete from v_menu_items ";
|
||||
$sql .= "where menu_uuid = :menu_uuid ";
|
||||
$sql .= "and ( ";
|
||||
$sql .= " menu_item_protected <> 'true' ";
|
||||
$sql .= " or menu_item_protected is null ";
|
||||
$sql .= ") ";
|
||||
//$sql .= "and ( ";
|
||||
//$sql .= " menu_item_protected <> 'true' ";
|
||||
//$sql .= " or menu_item_protected is null ";
|
||||
//$sql .= ") ";
|
||||
$parameters['menu_uuid'] = $this->menu_uuid;
|
||||
$this->database->execute($sql, $parameters);
|
||||
unset($sql, $parameters);
|
||||
@@ -786,7 +786,8 @@
|
||||
$menu_items = $menu_field['menu_items'];
|
||||
|
||||
//prepare the protected menus
|
||||
$menu_item_title = ($menu_field['menu_item_protected'] == "true") ? $menu_field['menu_item_title'] : $menu_field['menu_language_title'];
|
||||
//$menu_item_title = ($menu_field['menu_item_protected'] == "true") ? $menu_field['menu_item_title'] : $menu_field['menu_language_title'];
|
||||
$menu_item_title = $menu_field['menu_language_title'];
|
||||
|
||||
//prepare the menu_tags according to the category
|
||||
$menu_tags = '';
|
||||
@@ -867,7 +868,8 @@
|
||||
$menu_items = $submenu_field['menu_items'];
|
||||
|
||||
//prepare the protected menus
|
||||
$menu_item_title = ($submenu_field['menu_item_protected'] == "true") ? $submenu_field['menu_item_title'] : $submenu_field['menu_language_title'];
|
||||
//$menu_item_title = ($submenu_field['menu_item_protected'] == "true") ? $submenu_field['menu_item_title'] : $submenu_field['menu_language_title'];
|
||||
$menu_item_title = $submenu_field['menu_language_title'];
|
||||
|
||||
//prepare the menu_tags according to the category
|
||||
switch ($menu_item_category) {
|
||||
@@ -922,8 +924,8 @@
|
||||
|
||||
//get the menu from the database
|
||||
$sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, ";
|
||||
$sql .= "i.menu_item_title, i.menu_item_protected, i.menu_item_category, ";
|
||||
$sql .= "i.menu_item_icon, i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid ";
|
||||
$sql .= "i.menu_item_title, i.menu_item_category, i.menu_item_icon, ";
|
||||
$sql .= "i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid ";
|
||||
$sql .= "from v_menu_items as i, v_menu_languages as l ";
|
||||
$sql .= "where i.menu_item_uuid = l.menu_item_uuid ";
|
||||
$sql .= "and l.menu_language = :menu_language ";
|
||||
@@ -992,7 +994,9 @@
|
||||
}
|
||||
|
||||
//get the child menu from the database
|
||||
$sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_icon, i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid ";
|
||||
$sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, ";
|
||||
$sql .= "i.menu_item_title, i.menu_item_category, i.menu_item_icon, ";
|
||||
$sql .= "i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid ";
|
||||
$sql .= "from v_menu_items as i, v_menu_languages as l ";
|
||||
$sql .= "where i.menu_item_uuid = l.menu_item_uuid ";
|
||||
$sql .= "and l.menu_language = :menu_language ";
|
||||
@@ -1039,13 +1043,13 @@
|
||||
//add the row to the array
|
||||
$a[$x] = $row;
|
||||
|
||||
//prepare the protected menus
|
||||
if ($row['menu_item_protected'] == "true") {
|
||||
$a[$x]['menu_item_title'] = $row['menu_item_title'];
|
||||
}
|
||||
else {
|
||||
$a[$x]['menu_item_title'] = $row['menu_language_title'];
|
||||
}
|
||||
//prepare the menus
|
||||
//if ($row['menu_item_protected'] == "true") {
|
||||
// $a[$x]['menu_item_title'] = $row['menu_item_title'];
|
||||
//}
|
||||
//else {
|
||||
$a[$x]['menu_item_title'] = $row['menu_language_title'];
|
||||
//}
|
||||
|
||||
//get sub menu for children
|
||||
if (!empty($menu_item_uuid)) {
|
||||
|
||||
Reference in New Issue
Block a user