diff options
author | friendica <info@friendica.com> | 2013-08-13 18:10:03 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-08-13 18:10:03 -0700 |
commit | 680baff73d70769714d806c00cc84c6e65faba0f (patch) | |
tree | e4d66e2d7baf54597e125ad6c4c83dbbd65f1715 /include | |
parent | d6c6a2b144ad1c619cef70310bad7e0cdc920e77 (diff) | |
download | volse-hubzilla-680baff73d70769714d806c00cc84c6e65faba0f.tar.gz volse-hubzilla-680baff73d70769714d806c00cc84c6e65faba0f.tar.bz2 volse-hubzilla-680baff73d70769714d806c00cc84c6e65faba0f.zip |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/menu.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/menu.php b/include/menu.php index 951a2b1fe..cee17c1e9 100644 --- a/include/menu.php +++ b/include/menu.php @@ -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", |