From 1dc3253d4a8bac7c3186c4b5083b612e643d8694 Mon Sep 17 00:00:00 2001 From: Haakon Meland Eriksen Date: Sun, 29 Oct 2017 16:41:49 +0100 Subject: Added mode to Portfolio widget --- Zotlabs/Widget/Portfolio.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Portfolio.php b/Zotlabs/Widget/Portfolio.php index 216ca952c..0cd043246 100644 --- a/Zotlabs/Widget/Portfolio.php +++ b/Zotlabs/Widget/Portfolio.php @@ -20,6 +20,15 @@ class Portfolio { $album = $args['album']; if($args['title']) $title = $args['title']; + if(array_key_exists('mode', $args) && isset($args['mode'])) + $mode = $args['mode']; + else + $mode = ''; + if(array_key_exists('count', $args) && isset($args['count'])) + $count = $args['count']; + else + $count = ''; + /** * This may return incorrect permissions if you have multiple directories of the same name. @@ -92,6 +101,8 @@ class Portfolio { $tpl = get_markup_template('photo_album_portfolio.tpl'); $o .= replace_macros($tpl, array( '$photos' => $photos, + '$mode' => $mode, + '$count' => $count, '$album' => (($title) ? $title : $album), '$album_id' => rand(), '$album_edit' => array(t('Edit Album'), $album_edit), @@ -106,3 +117,4 @@ class Portfolio { } } + -- cgit v1.2.3 From 3f1a4b655900d64ad2c13f1906eb77eaf15d11b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 6 Nov 2017 20:13:14 -0800 Subject: second half of issue #893 - move channel default permissions to its own module so we can apply different page/widget layouts than for connedit; the relevant functionality is abandoned on mod_connedit but still intact. Trying a slightly different look/behaviour for inherited settings and the associated checkboxes. This may need a bit more tweaking but overall looks a lot cleaner. --- Zotlabs/Widget/Settings_menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index c15ad0980..e15ed96a5 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -107,7 +107,7 @@ class Settings_menu { if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), - 'url' => z_root() . '/connedit/' . $abook_self_id, + 'url' => z_root() . '/defperms', 'selected' => '' ); } -- cgit v1.2.3 From fc96cd371042a92ed180635b91924413392d3972 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 9 Nov 2017 11:34:41 +0100 Subject: load notifications links to /display via ajax if we are already in /display --- Zotlabs/Widget/Notifications.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index a857f1ad9..191f2afb6 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -139,6 +139,7 @@ class Notifications { } $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( + '$module' => \App::$module, '$notifications' => $notifications, '$loading' => t('Loading...') )); -- cgit v1.2.3 From 55995b0494843ef826dc38f862e9dced34ae0d96 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 11 Nov 2017 20:01:03 +0100 Subject: fix wiki pages not updating after creating new page --- Zotlabs/Widget/Wiki_pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php index ac44b8d88..39d4b1717 100644 --- a/Zotlabs/Widget/Wiki_pages.php +++ b/Zotlabs/Widget/Wiki_pages.php @@ -12,7 +12,7 @@ class Wiki_pages { if(! $arr['resource_id']) { $c = channelx_by_nick(argv(1)); - $w = \Zotlabs\Lib\NativeWiki::exists_by_name($c['channel_id'],argv(2)); + $w = \Zotlabs\Lib\NativeWiki::exists_by_name($c['channel_id'],urldecode(argv(2))); $arr = array( 'resource_id' => $w['resource_id'], 'channel_id' => $c['channel_id'], -- cgit v1.2.3 From c8dbcf8a2af7ac3b1a9e26c4c293574f919bd554 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 13 Nov 2017 22:01:37 +0100 Subject: sort combined private mail conversations by latest updated conversation instead of created parent --- Zotlabs/Widget/Conversations.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Conversations.php b/Zotlabs/Widget/Conversations.php index 56510750f..267d50fa0 100644 --- a/Zotlabs/Widget/Conversations.php +++ b/Zotlabs/Widget/Conversations.php @@ -28,6 +28,8 @@ class Conversations { require_once('include/message.php'); + $o = ''; + // private_messages_list() can do other more complicated stuff, for now keep it simple $r = private_messages_list(local_channel(), $mailbox, \App::$pager['start'], \App::$pager['itemspage']); @@ -36,13 +38,13 @@ class Conversations { return $o; } - $messages = array(); + $messages = []; foreach($r as $rr) { $selected = ((argc() == 3) ? intval(argv(2)) == intval($rr['id']) : $r[0]['id'] == $rr['id']); - $messages[] = array( + $messages[] = [ 'mailbox' => $mailbox, 'id' => $rr['id'], 'from_name' => $rr['from']['xchan_name'], @@ -57,14 +59,14 @@ class Conversations { 'date' => datetime_convert('UTC',date_default_timezone_get(),$rr['created'], 'c'), 'seen' => $rr['seen'], 'selected' => ((argv(1) != 'new') ? $selected : '') - ); + ]; } $tpl = get_markup_template('mail_head.tpl'); - $o .= replace_macros($tpl, array( + $o .= replace_macros($tpl, [ '$header' => $header, '$messages' => $messages - )); + ]); } return $o; -- cgit v1.2.3 From d13a6180be310cb184f891fa2b969542691c1863 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Nov 2017 20:16:51 -0800 Subject: Add private forums to forum widget. The link redirects to the remote channel page rather than a filtered view of your network page because you cannot post to a private forum from your own site. --- Zotlabs/Widget/Forums.php | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php index 002c0ee21..91b987746 100644 --- a/Zotlabs/Widget/Forums.php +++ b/Zotlabs/Widget/Forums.php @@ -29,18 +29,32 @@ class Forums { ); if($x1) { $xc = ids_to_querystr($x1,'xchan',true); + $x2 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'tag_deliver' and v = '1' and xchan in (" . $xc . ") ", intval(local_channel()) ); - if($x2) + + if($x2) { $xf = ids_to_querystr($x2,'xchan',true); + + // private forums + $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") and not xchan in (" . $xf . ") ", + intval(local_channel()) + ); + if($x3) { + $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true); + } + } } $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); - $r1 = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d $sql_extra order by xchan_name $limit ", + + + $r1 = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 $sql_extra order by xchan_name $limit ", intval(local_channel()) ); + if(! $r1) return $o; @@ -85,9 +99,21 @@ class Forums { $o .= '

' . t('Forums') . '

'; } -- cgit v1.2.3 From 78c9f752af8db5db290a57224fa1d0239a36a34d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Nov 2017 11:11:06 +0100 Subject: provide ability to pin apps to navbar from /apps. this removes the ability to have per custom navbar pinned apps - this can be added later if desired --- Zotlabs/Widget/Appcategories.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Appcategories.php b/Zotlabs/Widget/Appcategories.php index 490ec1abc..8ff14230f 100644 --- a/Zotlabs/Widget/Appcategories.php +++ b/Zotlabs/Widget/Appcategories.php @@ -26,6 +26,7 @@ class Appcategories { and term.uid = app_channel and term.otype = %d and term.term != 'nav_featured_app' + and term.term != 'nav_pinned_app' order by term.term asc", intval(local_channel()), intval(TERM_OBJ_APP) -- cgit v1.2.3 From 6c178d44858bbdfd582d09eb4568d32292c0b2c2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 22 Nov 2017 15:39:06 -0800 Subject: article feature --- Zotlabs/Widget/Categories.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 305869706..9bfa9742a 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -13,8 +13,14 @@ class Categories { if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards'))) return ''; + $articles = ((array_key_exists('articles',$arr) && $arr['articles']) ? true : false); + + if(($articles) && (! feature_enabled(\App::$profile['profile_uid'],'articles'))) + return ''; + + if((! \App::$profile['profile_uid']) - || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards) ? 'view_pages' : 'view_stream')))) { + || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) { return ''; } @@ -25,6 +31,8 @@ class Categories { if($cards) return cardcategories_widget($srchurl, $cat); + elseif($articles) + return articlecategories_widget($srchurl, $cat); else return categories_widget($srchurl, $cat); -- cgit v1.2.3 From 64c81ed17474cfa3dfe0e84475a49089c0af0106 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Nov 2017 15:12:40 +0100 Subject: missing files --- Zotlabs/Widget/Hq_controls.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Zotlabs/Widget/Hq_controls.php (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php new file mode 100644 index 000000000..0caa54a1a --- /dev/null +++ b/Zotlabs/Widget/Hq_controls.php @@ -0,0 +1,26 @@ + t('HQ Control Panel'), + '$menu' => [ + 'create' => [ + 'label' => t('Create a new post'), + 'id' => 'jot-toggle', + 'href' => '#', + 'class' => '' + ] + ] + ] + ); + } +} -- cgit v1.2.3 From 014b629928b19dec4bfa2f12f961fd4048d71d19 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 25 Nov 2017 14:33:57 +0100 Subject: fix regression in cdav calendar widget --- Zotlabs/Widget/Cdav.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Cdav.php b/Zotlabs/Widget/Cdav.php index 60a860f93..589f915c5 100644 --- a/Zotlabs/Widget/Cdav.php +++ b/Zotlabs/Widget/Cdav.php @@ -63,9 +63,10 @@ class Cdav { $sharees = []; $share_displayname = []; + foreach($invites as $invite) { if(strpos($invite->href, 'mailto:') !== false) { - $sharee = channelx_by_hash(substr($invite->href, 7)); + $sharee = channelx_by_nick(substr($invite->principal, 11)); $sharees[] = [ 'name' => $sharee['channel_name'], 'access' => (($invite->access == 3) ? ' (RW)' : ' (R)'), @@ -173,4 +174,4 @@ class Cdav { } } -} \ No newline at end of file +} -- cgit v1.2.3 From dcad9ce26a0de72ba3ad5b86ddb62298598ac380 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 1 Dec 2017 21:00:39 +0100 Subject: add a filter for notification to show new posts only --- Zotlabs/Widget/Notifications.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 191f2afb6..450d3565e 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -20,8 +20,10 @@ class Notifications { 'label' => t('View your network activity') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all notifications read') + ], + 'filter' => [ + 'label' => t('Show new posts only') ] ]; @@ -36,8 +38,10 @@ class Notifications { 'label' => t('View your home activity') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all notifications seen') + ], + 'filter' => [ + 'label' => t('Show new posts only') ] ]; @@ -52,7 +56,6 @@ class Notifications { 'label' => t('View your private mails') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all messages seen') ] ]; @@ -68,7 +71,6 @@ class Notifications { 'label' => t('View events') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all events seen') ] ]; @@ -104,7 +106,6 @@ class Notifications { 'label' => t('View all notices') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all notices seen') ] ]; @@ -132,8 +133,10 @@ class Notifications { 'label' => t('View the public stream') ], 'markall' => [ - 'url' => '#', 'label' => t('Mark all notifications seen') + ], + 'filter' => [ + 'label' => t('Show new posts only') ] ]; } -- cgit v1.2.3 From 44cb68a3561e6079e6185c1000753896b89c5129 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 6 Dec 2017 09:12:28 +0100 Subject: resolve merge conflict --- Zotlabs/Widget/Wiki_pages.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php index 39d4b1717..46f12f092 100644 --- a/Zotlabs/Widget/Wiki_pages.php +++ b/Zotlabs/Widget/Wiki_pages.php @@ -5,6 +5,42 @@ namespace Zotlabs\Widget; class Wiki_pages { + function create_missing_page($arr) { + if(argc() < 4) + return; + + $c = channelx_by_nick(argv(1)); + $w = \Zotlabs\Lib\NativeWiki::exists_by_name($c['channel_id'],urldecode(argv(2))); + $arr = array( + 'resource_id' => $w['resource_id'], + 'channel_id' => $c['channel_id'], + 'channel_address' => $c['channel_address'], + 'refresh' => false + ); + + $can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_wiki'); + + $can_delete = ((local_channel() && (local_channel() == \App::$profile['uid'])) ? true : false); + $pageName = urlencode(escape_tags(urldecode(argv(3)))); + + return replace_macros(get_markup_template('wiki_page_not_found.tpl'), array( + '$resource_id' => $arr['resource_id'], + '$channel_address' => $arr['channel_address'], + '$wikiname' => $wikiname, + '$canadd' => $can_create, + '$candel' => $can_delete, + '$addnew' => t('Add new page'), + '$typelock' => $typelock, + '$lockedtype' => $w['mimeType'], + '$mimetype' => mimetype_select(0,$w['mimeType'], + [ 'text/markdown' => t('Markdown'), 'text/bbcode' => t('BBcode'), 'text/plain' => t('Text') ]), + '$pageName' => array('missingPageName', 'Create Page' , $pageName), + '$refresh' => $arr['refresh'], + '$options' => t('Options'), + '$submit' => t('Submit') + )); + } + function widget($arr) { if(argc() < 3) -- cgit v1.2.3 From 9ba72a06b3c78fd9b9a3cb2bb280ec7cacbdd140 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Wed, 6 Dec 2017 07:51:21 -0500 Subject: Fix 'unable to add pages with spaces' (pr 922) --- Zotlabs/Widget/Wiki_pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php index 46f12f092..ecd2c9100 100644 --- a/Zotlabs/Widget/Wiki_pages.php +++ b/Zotlabs/Widget/Wiki_pages.php @@ -21,7 +21,7 @@ class Wiki_pages { $can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_wiki'); $can_delete = ((local_channel() && (local_channel() == \App::$profile['uid'])) ? true : false); - $pageName = urlencode(escape_tags(urldecode(argv(3)))); + $pageName = addslashes(escape_tags(urldecode(argv(3)))); return replace_macros(get_markup_template('wiki_page_not_found.tpl'), array( '$resource_id' => $arr['resource_id'], -- cgit v1.2.3 From 5b1ef760a06dd892a6decf6a621e710b5ae4e7bd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 11 Dec 2017 16:50:25 +0100 Subject: notification: slight animation for loading... and do not remove public stream items on click (we can not mark them read) --- Zotlabs/Widget/Notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 450d3565e..a677d84c9 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -144,7 +144,7 @@ class Notifications { $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$module' => \App::$module, '$notifications' => $notifications, - '$loading' => t('Loading...') + '$loading' => t('Loading') )); return $o; -- cgit v1.2.3 From 4ab4224277f52a24c22a5133ee529f2dc3232ab0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 28 Dec 2017 14:06:30 -0800 Subject: Make affinity widget settings work. It's entirely possible they never did work correctly. I'm not comfortable over-riding the network_page_default config in this way but this is the way I've always set the affinity and it has worked just fine for me for several years and there haven't been any other requests to extend the network page default options. --- Zotlabs/Widget/Affinity.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index 439ba1f33..a3e5b5c07 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -9,15 +9,9 @@ class Affinity { if(! local_channel()) return ''; - // Get default cmin value from pconfig, but allow GET parameter to override - $cmin = intval(get_pconfig(local_channel(),'affinity','cmin')); - $cmin = (($cmin) ? $cmin : 0); - $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $cmin); - - // Get default cmax value from pconfig, but allow GET parameter to override - $cmax = intval(get_pconfig(local_channel(),'affinity','cmax')); - $cmax = (($cmax) ? $cmax : 99); - $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $cmax); + + $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : 0); + $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : 99); if(feature_enabled(local_channel(),'affinity')) { -- cgit v1.2.3 From fefc78a849ade52927f6ae88a3c1f03501d66930 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 7 Jan 2018 19:14:19 +0100 Subject: start with nonactive state for the notifications button and display some text if there are no notifications on small screens only --- Zotlabs/Widget/Notifications.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index a677d84c9..5a0c1f3d5 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -144,6 +144,7 @@ class Notifications { $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$module' => \App::$module, '$notifications' => $notifications, + '$no_notifications' => t('Sorry, you have got no notifications at the moment'), '$loading' => t('Loading') )); -- cgit v1.2.3