mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 12:17:42 +02:00
Menus Plugin: bug with categories - fixed
This commit is contained in:
@@ -122,6 +122,9 @@
|
||||
$menu_item_order = '';
|
||||
$errors = array();
|
||||
|
||||
// Get current category
|
||||
$menu_item_category = $current_category = (Request::get('category')) ? Request::get('category') : '' ;
|
||||
|
||||
// Add new menu item
|
||||
if (Request::post('menu_add_item')) {
|
||||
|
||||
@@ -131,7 +134,7 @@
|
||||
|
||||
if (Request::post('menu_item_name')) $menu_item_name = Request::post('menu_item_name'); else $menu_item_name = '';
|
||||
if (Request::post('menu_item_link')) $menu_item_link = Request::post('menu_item_link'); else $menu_item_link = '';
|
||||
if (Request::post('menu_item_category')) $menu_item_category = Request::post('menu_item_category'); else $menu_item_category = '';
|
||||
if (Request::post('menu_item_category')) $menu_item_category = Request::post('menu_item_category'); else $menu_item_category = $current_category;
|
||||
if (Request::post('menu_item_target')) $menu_item_target = Request::post('menu_item_target'); else $menu_item_target = '';
|
||||
if (Request::post('menu_item_order')) $menu_item_order = Request::post('menu_item_order'); else $menu_item_order = '';
|
||||
|
||||
|
@@ -20,13 +20,15 @@
|
||||
|
||||
$items = $menu->select('[category="'.$category.'"]', 'all', null, array('id', 'name', 'link', 'target', 'order', 'category'), 'order', 'ASC');
|
||||
|
||||
$category_to_add = ($category == '') ? '' : '&category='.$category;
|
||||
|
||||
?>
|
||||
|
||||
<h3><?php echo __('Category', 'menu'); ?>: <?php echo ($category == '') ? 'default' : $category; ?></h3>
|
||||
<br />
|
||||
<?php
|
||||
echo (
|
||||
Html::anchor(__('Create new item', 'menu'), 'index.php?id=menu&action=add', array('title' => __('Create new page', 'menu'), 'class' => 'btn btn-small'))
|
||||
Html::anchor(__('Create new item', 'menu'), 'index.php?id=menu&action=add'.$category_to_add , array('title' => __('Create new page', 'menu'), 'class' => 'btn btn-small'))
|
||||
);
|
||||
?>
|
||||
<br /><br />
|
||||
|
Reference in New Issue
Block a user