aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-11 19:04:07 -0700
committerfriendica <info@friendica.com>2013-08-11 19:04:07 -0700
commit6191cfef2adaa52019940cc448e28e2ad1a7ae6d (patch)
treec0d7fc1444a1c8fdfa013e8831f96f847667f9f2 /include
parent4eca591aed1e71a94c1f80b87aad9bb844199ffc (diff)
downloadvolse-hubzilla-6191cfef2adaa52019940cc448e28e2ad1a7ae6d.tar.gz
volse-hubzilla-6191cfef2adaa52019940cc448e28e2ad1a7ae6d.tar.bz2
volse-hubzilla-6191cfef2adaa52019940cc448e28e2ad1a7ae6d.zip
check these in so I can go back and find out why the stylsheet is horked
Diffstat (limited to 'include')
-rw-r--r--include/menu.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/menu.php b/include/menu.php
new file mode 100644
index 000000000..98c18a45b
--- /dev/null
+++ b/include/menu.php
@@ -0,0 +1,40 @@
+<?php /** @file */
+
+require_once('include/security.php');
+
+function menu_fetch($name,$uid,$observer_xchan) {
+
+ $sql_options = permission_sql($uid);
+
+ $r = q("select * from menu where menu_channel_id = %d and menu_name = '%s' limit 1",
+ intval($uid),
+ dbesc($name)
+ );
+ if($r) {
+ $x = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d
+ $sql_options
+ order by mitem_order asc, mitem_desc asc",
+ intval($x[0]['menu_id']),
+ intval($uid)
+ );
+
+ $result = array('menu' => $r[0], 'items' => $x );
+
+
+ }
+ return null;
+}
+
+
+function menu_render($menu) {
+ if(! $menu)
+ return '';
+ for($x = 0; $x < count($menu['items']); $x ++)
+ if($menu['items']['mitem_flags'] & MENU_ITEM_ZID)
+ $menu['items']['link'] = zid($menu['items']['link']);
+
+ return replace_macros(get_markup_template('usermenu.tpl'),array(
+ '$menu' => $menu['menu'],
+ '$items' => $menu['items']
+ ));
+}