aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-02 16:49:09 -0800
committerfriendica <info@friendica.com>2014-02-02 16:49:09 -0800
commit2768262f9386e063efb4d7e276c5a7108c40d44b (patch)
tree0b1c7a007a24b0b6bc85775d5bb14f55683ccd55
parentabb68e846d828995f6ba016246143ba3d6f04181 (diff)
downloadvolse-hubzilla-2768262f9386e063efb4d7e276c5a7108c40d44b.tar.gz
volse-hubzilla-2768262f9386e063efb4d7e276c5a7108c40d44b.tar.bz2
volse-hubzilla-2768262f9386e063efb4d7e276c5a7108c40d44b.zip
Add switch to allow menus to be used as bookmark collections
-rw-r--r--include/menu.php2
-rw-r--r--mod/menu.php4
-rw-r--r--view/tpl/menuedit.tpl2
3 files changed, 6 insertions, 2 deletions
diff --git a/include/menu.php b/include/menu.php
index d69c5d0d3..be9831951 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -152,7 +152,7 @@ function menu_edit($arr) {
return false;
}
- return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d,
+ return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d
where menu_id = %d and menu_channel_id = %d limit 1",
dbesc($menu_name),
dbesc($menu_desc),
diff --git a/mod/menu.php b/mod/menu.php
index 47eed6484..3d6b9939c 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -8,6 +8,8 @@ function menu_post(&$a) {
return;
$_REQUEST['menu_channel_id'] = local_user();
+ if($_REQUEST['menu_bookmark'])
+ $_REQUEST['menu_flags'] = MENU_BOOKMARK;
$menu_id = ((argc() > 1) ? intval(argv(1)) : 0);
if($menu_id) {
@@ -76,6 +78,7 @@ function menu_content(&$a) {
'$header' => t('New Menu'),
'$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''),
+ '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu can be used to store saved bookmarks'), ''),
'$submit' => t('Create')
));
return $o;
@@ -104,6 +107,7 @@ function menu_content(&$a) {
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
+ '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu can be used to store saved bookmarks'), ''),
'$submit' => t('Modify')
));
return $o;
diff --git a/view/tpl/menuedit.tpl b/view/tpl/menuedit.tpl
index ea9e775e2..324dbe426 100644
--- a/view/tpl/menuedit.tpl
+++ b/view/tpl/menuedit.tpl
@@ -13,7 +13,7 @@
{{include file="field_input.tpl" field=$menu_name}}
{{include file="field_input.tpl" field=$menu_desc}}
-
+{{include file="field_checkbox.tpl" field=$menu_bookmark}}
<div class="menuedit-submit-wrapper" >
<input type="submit" name="submit" class="menuedit-submit" value="{{$submit}}" />
</div>