menu management complete (as opposed to menu *content* management, which is not). As usual, this means functionally complete - as theming and presentation have been left for those more suited to the task.
This commit is contained in:
@@ -38,6 +38,18 @@ 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",
|
||||
intval($menu_id),
|
||||
intval($channel_id)
|
||||
);
|
||||
|
||||
return (($r) ? $r[0] : false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function menu_create($arr) {
|
||||
|
||||
|
||||
@@ -103,6 +115,17 @@ function menu_edit($arr) {
|
||||
return false;
|
||||
|
||||
|
||||
$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)
|
||||
);
|
||||
if(($r) && ($r[0]['menu_id'] != $menu_id)) {
|
||||
logger('menu_edit: duplicate menu name for channel ' . $menu_channel_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$menu_channel_id = intval($arr['menu_channel_id']);
|
||||
|
||||
$r = q("select * from menu where menu_id = %d and menu_channel_id = %d limit 1",
|
||||
|
||||
Reference in New Issue
Block a user