aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-19 13:41:38 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-19 13:41:38 -0700
commit82f2765f7bbc990c7106b3d1b3185c8bf04112fb (patch)
treee94602dd0874209a188d8befec108ef05798de4b
parent01efda6850db9347351f290da6026d6cbc0abe49 (diff)
parent71117628bc0cba92b75caea46379b45c64c2cf43 (diff)
downloadvolse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.tar.gz
volse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.tar.bz2
volse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
-rw-r--r--include/comanche.php18
-rw-r--r--include/menu.php66
-rw-r--r--view/css/widgets.css1
-rwxr-xr-xview/tpl/page_display.tpl2
-rw-r--r--view/tpl/usermenu.tpl27
5 files changed, 44 insertions, 70 deletions
diff --git a/include/comanche.php b/include/comanche.php
index fcf50d67e..e0d3af985 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -133,7 +133,19 @@ function comanche_get_channel_id() {
return $channel_id;
}
-function comanche_block($name) {
+function comanche_block($s) {
+ $var = array();
+ $matches = array();
+ $name = $s;
+
+ $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $s, $matches, PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $var[$mtch[1]] = $mtch[2];
+ $name = str_replace($mtch[0], '', $name);
+ }
+ }
+
$o = '';
$channel_id = comanche_get_channel_id();
@@ -143,12 +155,12 @@ function comanche_block($name) {
dbesc($name)
);
if($r) {
- $o = '<div class="bblock">';
+ $o .= (($var['wrap'] == 'none') ? '' : '<div class="bblock">');
if($r[0]['title'])
$o .= '<h3>' . $r[0]['title'] . '</h3>';
$o .= prepare_text($r[0]['body'], $r[0]['mimetype']);
- $o .= '</div>';
+ $o .= (($var['wrap'] == 'none') ? '' : '</div>');
}
}
diff --git a/include/menu.php b/include/menu.php
index 81e986132..b4f4555a5 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -25,6 +25,7 @@ function menu_fetch($name,$uid,$observer_xchan) {
}
function menu_render($menu, $class='', $edit = false) {
+
if(! $menu)
return '';
@@ -40,6 +41,7 @@ function menu_render($menu, $class='', $edit = false) {
'$menu' => $menu['menu'],
'$class' => $class,
'$edit' => (($edit) ? t("Edit") : ''),
+ '$id' => $menu['menu']['menu_id'],
'$items' => $menu['items']
));
}
@@ -60,14 +62,13 @@ function menu_fetch_id($menu_id,$channel_id) {
function menu_create($arr) {
-
$menu_name = trim(escape_tags($arr['menu_name']));
$menu_desc = trim(escape_tags($arr['menu_desc']));
$menu_flags = intval($arr['menu_flags']);
-
- if(! $menu_desc)
- $menu_desc = $menu_name;
+ //allow menu_desc (title) to be empty
+ //if(! $menu_desc)
+ // $menu_desc = $menu_name;
if(! $menu_name)
return false;
@@ -144,8 +145,9 @@ function menu_edit($arr) {
$menu_desc = trim(escape_tags($arr['menu_desc']));
$menu_flags = intval($arr['menu_flags']);
- if(! $menu_desc)
- $menu_desc = $menu_name;
+ //allow menu_desc (title) to be empty
+ //if(! $menu_desc)
+ // $menu_desc = $menu_name;
if(! $menu_name)
return false;
@@ -227,31 +229,10 @@ function menu_add_item($menu_id, $uid, $arr) {
$channel = get_app()->get_channel();
}
- if (($channel)
- && (! $arr['contact_allow'])
- && (! $arr['group_allow'])
- && (! $arr['contact_deny'])
- && (! $arr['group_deny'])) {
- $str_group_allow = $channel['channel_allow_gid'];
- $str_contact_allow = $channel['channel_allow_cid'];
- $str_group_deny = $channel['channel_deny_gid'];
- $str_contact_deny = $channel['channel_deny_cid'];
- }
- else {
-
- // use the posted permissions
-
- $str_group_allow = perms2str($arr['group_allow']);
- $str_contact_allow = perms2str($arr['contact_allow']);
- $str_group_deny = perms2str($arr['group_deny']);
- $str_contact_deny = perms2str($arr['contact_deny']);
- }
-
-// unused
-// $allow_cid = perms2str($arr['allow_cid']);
-// $allow_gid = perms2str($arr['allow_gid']);
-// $deny_cid = perms2str($arr['deny_cid']);
-// $deny_gid = perms2str($arr['deny_gid']);
+ $str_group_allow = perms2str($arr['group_allow']);
+ $str_contact_allow = perms2str($arr['contact_allow']);
+ $str_group_deny = perms2str($arr['group_deny']);
+ $str_contact_deny = perms2str($arr['contact_deny']);
$r = q("insert into menu_item ( mitem_link, mitem_desc, mitem_flags, allow_cid, allow_gid, deny_cid, deny_gid, mitem_channel_id, mitem_menu_id, mitem_order ) values ( '%s', '%s', %d, '%s', '%s', '%s', '%s', %d, %d, %d ) ",
dbesc($mitem_link),
@@ -283,25 +264,10 @@ function menu_edit_item($menu_id, $uid, $arr) {
$channel = get_app()->get_channel();
}
- if ((! $arr['contact_allow'])
- && (! $arr['group_allow'])
- && (! $arr['contact_deny'])
- && (! $arr['group_deny'])) {
- $str_group_allow = $channel['channel_allow_gid'];
- $str_contact_allow = $channel['channel_allow_cid'];
- $str_group_deny = $channel['channel_deny_gid'];
- $str_contact_deny = $channel['channel_deny_cid'];
- }
- else {
-
- // use the posted permissions
-
- $str_group_allow = perms2str($arr['group_allow']);
- $str_contact_allow = perms2str($arr['contact_allow']);
- $str_group_deny = perms2str($arr['group_deny']);
- $str_contact_deny = perms2str($arr['contact_deny']);
- }
-
+ $str_group_allow = perms2str($arr['group_allow']);
+ $str_contact_allow = perms2str($arr['contact_allow']);
+ $str_group_deny = perms2str($arr['group_deny']);
+ $str_contact_deny = perms2str($arr['contact_deny']);
$r = q("update menu_item set mitem_link = '%s', mitem_desc = '%s', mitem_flags = %d, allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', mitem_order = %d where mitem_channel_id = %d and mitem_menu_id = %d and mitem_id = %d",
dbesc($mitem_link),
diff --git a/view/css/widgets.css b/view/css/widgets.css
index 8f31a3603..566dd2b8a 100644
--- a/view/css/widgets.css
+++ b/view/css/widgets.css
@@ -7,7 +7,6 @@
margin-top: 0px;
}
-
.widget .nav-pills > li > a {
padding: 6px 10px;
}
diff --git a/view/tpl/page_display.tpl b/view/tpl/page_display.tpl
index e6a59a8c4..5328648b9 100755
--- a/view/tpl/page_display.tpl
+++ b/view/tpl/page_display.tpl
@@ -2,7 +2,7 @@
<div class="generic-content-wrapper" id="page-content-wrapper" >
{{if $title}}<h2 class="page-title">{{$title}}</h2>{{/if}}
- <div class="page-author"><a class=="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
+ <div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
<div class="page-date">{{$date}}</div>
<div class="page-body">{{$body}}</div>
</div>
diff --git a/view/tpl/usermenu.tpl b/view/tpl/usermenu.tpl
index a5c6faa99..b05f785a8 100644
--- a/view/tpl/usermenu.tpl
+++ b/view/tpl/usermenu.tpl
@@ -1,16 +1,13 @@
-<div class="pmenu{{if $class}} {{$class}}{{/if}}">
-{{if $menu.menu_desc}}
- <h3 class="pmenu-title">{{$menu.menu_desc}}</h3>
-{{/if}}
-{{if $edit}}
-<a href="mitem/{{$menu.menu_id}}" title="{{$edit}}"><i class="icon-pencil fakelink" title="{{$edit}}"></i></a>
-{{/if}}
-{{if $items }}
-<ul class="pmenu-body">
-{{foreach $items as $mitem }}
-<li class="pmenu-item"><a href="{{$mitem.mitem_link}}" {{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}</a></li>
-{{/foreach }}
-</ul>
-{{/if}}
-<div class="pmenu-end"></div>
+<div id="pmenu-{{$id}}" class="pmenu{{if !$class}} widget{{else}} {{$class}}{{/if}}">
+ {{if $menu.menu_desc}}
+ <h3 class="pmenu-title">{{$menu.menu_desc}}{{if $edit}} <a href="mitem/{{$menu.menu_id}}" title="{{$edit}}"><i class="icon-pencil fakelink" title="{{$edit}}"></i></a>{{/if}}</h3>
+ {{/if}}
+ {{if $items }}
+ <ul class="pmenu-body{{if !$class}} nav nav-pills nav-stacked{{/if}}">
+ {{foreach $items as $mitem }}
+ <li class="pmenu-item"><a href="{{$mitem.mitem_link}}" {{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}</a></li>
+ {{/foreach }}
+ </ul>
+ {{/if}}
+ <div class="pmenu-end"></div>
</div>