diff options
Diffstat (limited to 'include/menu.php')
-rw-r--r-- | include/menu.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/menu.php b/include/menu.php index 8d4664385..900b48e65 100644 --- a/include/menu.php +++ b/include/menu.php @@ -40,6 +40,7 @@ function menu_render($menu) { } + function menu_fetch_id($menu_id,$channel_id) { $r = q("select * from menu where menu_id = %d and menu_channel_id = %d limit 1", @@ -117,6 +118,8 @@ function menu_edit($arr) { return false; + $menu_channel_id = intval($arr['menu_channel_id']); + $r = q("select menu_id from menu where menu_name = '%s' and menu_channel_id = %d limit 1", dbesc($menu_name), intval($menu_channel_id) @@ -127,9 +130,6 @@ function menu_edit($arr) { } - - $menu_channel_id = intval($arr['menu_channel_id']); - $r = q("select * from menu where menu_id = %d and menu_channel_id = %d limit 1", intval($menu_id), intval($menu_channel_id) @@ -140,14 +140,16 @@ function menu_edit($arr) { } - $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d limit 1", + $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d and menu_desc = '%s' limit 1", dbesc($menu_name), - intval($menu_channel_id) + intval($menu_channel_id), + dbesc($menu_desc) ); if($r) return false; + return q("update menu set menu_name = '%s', menu_desc = '%s' where menu_id = %d and menu_channel_id = %d limit 1", dbesc($menu_name), |