mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-29 18:59:21 +02:00
Fix: add possibility to remove all menu items
This commit is contained in:
parent
cb6e9a6a88
commit
cc26b5c744
@ -27,11 +27,11 @@ $pluginThemes = Plugins::getThemes();
|
|||||||
if (isset($_POST['template'])) {
|
if (isset($_POST['template'])) {
|
||||||
$template = $_POST['template'];
|
$template = $_POST['template'];
|
||||||
|
|
||||||
if (isset($_POST['menu'])) {
|
if (isset($_POST['save'])) {
|
||||||
$post_menu = $_POST['menu'];
|
$post_menu = $_POST['menu'] ?? [];
|
||||||
$post_menu_link = $_POST['menu_link'];
|
$post_menu_link = $_POST['menu_link'] ?? [];
|
||||||
$post_menu_blank = $_POST['menu_blank'];
|
$post_menu_blank = $_POST['menu_blank'] ?? [];
|
||||||
$post_menu_color = $_POST['menu_color'];
|
$post_menu_color = $_POST['menu_color'] ?? [];
|
||||||
if (count($post_menu) != count($post_menu_link)) {
|
if (count($post_menu) != count($post_menu_link)) {
|
||||||
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
||||||
return;
|
return;
|
||||||
@ -135,7 +135,7 @@ if (isset($_POST['template'])) {
|
|||||||
<form method="post" id="menus-form" action="?p=menus">
|
<form method="post" id="menus-form" action="?p=menus">
|
||||||
<?php csrf(); ?>
|
<?php csrf(); ?>
|
||||||
<input type="hidden" name="template" value="<?php echo $template ?>"/>
|
<input type="hidden" name="template" value="<?php echo $template ?>"/>
|
||||||
<button type="submit" class="btn btn-info">Save</button><br/><br/>
|
<button type="submit" name="save" class="btn btn-info">Save</button><br/><br/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php foreach ($config['menu_categories'] as $id => $cat): ?>
|
<?php foreach ($config['menu_categories'] as $id => $cat): ?>
|
||||||
<div class="col-md-12 col-lg-6">
|
<div class="col-md-12 col-lg-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user