private function deleteMenu() { if ($this->fk_menu > 0) { global $db, $conf, $user; $menu = new Menubase($db, 'all'); if ($menu->fetch($this->fk_menu) > 0) { $menu->delete($user); } } }
print '<br><div class="center">'; print '<input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">'; print ' '; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '</div>'; print '</form>'; } elseif ($action == 'edit') { print_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup'); print '<br>'; print '<form action="./edit.php?action=update" method="POST" name="formmenuedit">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="handler_origine" value="' . $menu_handler . '">'; print '<input type="hidden" name="menuId" value="' . $_GET['menuId'] . '">'; print '<table class="border" width="100%">'; $menu = new Menubase($db); $result = $menu->fetch($_GET['menuId']); //var_dump($menu); // Id print '<tr><td>' . $langs->trans('Id') . '</td><td>' . $menu->id . '</td><td>' . $langs->trans('DetailId') . '</td></tr>'; // Module print '<tr><td>' . $langs->trans('MenuModule') . '</td><td>' . $menu->module . '</td><td>' . $langs->trans('DetailMenuModule') . '</td></tr>'; // Handler if ($menu->menu_handler == 'all') { $handler = $langs->trans('AllMenus'); } else { $handler = $menu->menu_handler; } print '<tr><td class="fieldrequired">' . $langs->trans('MenuHandler') . '</td><td>' . $handler . '</td><td>' . $langs->trans('DetailMenuHandler') . '</td></tr>'; // User print '<tr><td class="nowrap fieldrequired">' . $langs->trans('MenuForUsers') . '</td><td><select class="flat" name="user">'; print '<option value="2"' . ($menu->user == 2 ? ' selected' : '') . '>' . $langs->trans("AllMenus") . '</option>';