diff options
Diffstat (limited to 'Zotlabs/Widget')
66 files changed, 405 insertions, 188 deletions
diff --git a/Zotlabs/Widget/Activity.php b/Zotlabs/Widget/Activity.php index 5d9795c7e..34e0f67dc 100644 --- a/Zotlabs/Widget/Activity.php +++ b/Zotlabs/Widget/Activity.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Activity + * * Description: Shows the unseen activity count per contact + */ + namespace Zotlabs\Widget; class Activity { diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index b7a69752e..daaf5fb67 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -1,5 +1,12 @@ <?php +/** + * * Name: Activity filters + * * Description: Filters for the network stream + * * Requires: network + */ + + namespace Zotlabs\Widget; use App; diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php index d3fe2a30f..e8ee11508 100644 --- a/Zotlabs/Widget/Activity_order.php +++ b/Zotlabs/Widget/Activity_order.php @@ -2,6 +2,12 @@ namespace Zotlabs\Widget; +/** + * * Name: Activity order + * * Description: Order the network stream by posted date, last commented or by date unthreaded + * * Requires: network + */ + class Activity_order { function widget($arr) { @@ -22,7 +28,7 @@ class Activity_order { switch($_GET['order']){ case 'post': $postord_active = 'active'; - set_pconfig(local_channel(), 'mod_network', 'order', 1); + set_pconfig(local_channel(), 'mod_network', 'order', 1); break; case 'comment': $commentord_active = 'active'; diff --git a/Zotlabs/Widget/Admin.php b/Zotlabs/Widget/Admin.php index f349377a0..0a7a6925f 100644 --- a/Zotlabs/Widget/Admin.php +++ b/Zotlabs/Widget/Admin.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Admin menu + * * Requires: admin + */ + namespace Zotlabs\Widget; class Admin { diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index 572af0503..e083e576c 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Affinity Tool + * * Description: Filter the network stream by affinity, requires the Affinity Tool App + * * Requires: network + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Apps; @@ -13,7 +19,7 @@ class Affinity { if(! Apps::system_app_installed(local_channel(),'Affinity Tool')) return; - + $default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0); $default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99); @@ -54,7 +60,7 @@ class Affinity { '$refresh' => t('Refresh'), '$labels' => $label_str, )); - + $arr = array('html' => $x); call_hooks('main_slider',$arr); @@ -63,4 +69,4 @@ class Affinity { } } - + diff --git a/Zotlabs/Widget/Album.php b/Zotlabs/Widget/Album.php index f359e6d0f..003f6f49d 100644 --- a/Zotlabs/Widget/Album.php +++ b/Zotlabs/Widget/Album.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Album + * * Description: Displays an album with a title which can be defined via the 'album' and 'title' variable + * * Requires: channel, articles, cards, wiki + */ + namespace Zotlabs\Widget; require_once('include/attach.php'); @@ -99,7 +105,7 @@ class Album { '$upload_form' => $upload_form, '$usage' => $usage_message )); - + return $o; } } diff --git a/Zotlabs/Widget/Appcategories.php b/Zotlabs/Widget/Appcategories.php index e916f095f..31fb2542e 100644 --- a/Zotlabs/Widget/Appcategories.php +++ b/Zotlabs/Widget/Appcategories.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: App categories + * * Description: Shows a menu with various app categories + * * Requires: apps + */ + namespace Zotlabs\Widget; class Appcategories { diff --git a/Zotlabs/Widget/Appcloud.php b/Zotlabs/Widget/Appcloud.php index 2a4671eee..791d534c2 100644 --- a/Zotlabs/Widget/Appcloud.php +++ b/Zotlabs/Widget/Appcloud.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: App cloud + * * Description: Shows a cloud with various app categories + * * Requires: apps + */ + namespace Zotlabs\Widget; class Appcloud { diff --git a/Zotlabs/Widget/Appstore.php b/Zotlabs/Widget/Appstore.php index da05c0b62..d8499152a 100644 --- a/Zotlabs/Widget/Appstore.php +++ b/Zotlabs/Widget/Appstore.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: App store menu + * * Description: Shows a menu with links to installed and available apps + * * Requires: apps + */ + namespace Zotlabs\Widget; diff --git a/Zotlabs/Widget/Archive.php b/Zotlabs/Widget/Archive.php index 9adaac38f..e712a8236 100644 --- a/Zotlabs/Widget/Archive.php +++ b/Zotlabs/Widget/Archive.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Archive + * * Description: A menu with links to content sorted by years and months + * * Requires: channel, articles, cards + */ + namespace Zotlabs\Widget; diff --git a/Zotlabs/Widget/Bookmarkedchats.php b/Zotlabs/Widget/Bookmarkedchats.php index d64bbdb4b..5d6d000c1 100644 --- a/Zotlabs/Widget/Bookmarkedchats.php +++ b/Zotlabs/Widget/Bookmarkedchats.php @@ -1,14 +1,15 @@ <?php +/** + * * Name: Bookmarked chats + * * Description: A menu with bookmarked chats + */ + namespace Zotlabs\Widget; class Bookmarkedchats { function widget($arr) { - - if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) - return ''; - $h = get_observer_hash(); if(! $h) return; diff --git a/Zotlabs/Widget/Catcloud.php b/Zotlabs/Widget/Catcloud.php index c53f9bbf6..5740caab7 100644 --- a/Zotlabs/Widget/Catcloud.php +++ b/Zotlabs/Widget/Catcloud.php @@ -2,6 +2,13 @@ namespace Zotlabs\Widget; +/** + * * Name: Category cloud + * * Description: Display category links in a cloud + * * Requires: channel, cards, articles + */ + + class Catcloud { function widget($arr) { @@ -22,7 +29,7 @@ class Catcloud { return card_catblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash']); case 'articles': - + if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_pages')) return ''; diff --git a/Zotlabs/Widget/Catcloud_wall.php b/Zotlabs/Widget/Catcloud_wall.php index 3795987cc..4ee30d023 100644 --- a/Zotlabs/Widget/Catcloud_wall.php +++ b/Zotlabs/Widget/Catcloud_wall.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Category cloud wall + * * Description: Display category links in a cloud restricted to wall posts + * * Requires: channel + */ + namespace Zotlabs\Widget; class Catcloud_wall { diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 94ad469da..0c6996d55 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Categories + * * Description: Display a menu with links to categories + * * Requires: channel, articles, cards, cloud + */ + namespace Zotlabs\Widget; use App; diff --git a/Zotlabs/Widget/Cdav.php b/Zotlabs/Widget/Cdav.php index ce716b455..f84f5cb04 100644 --- a/Zotlabs/Widget/Cdav.php +++ b/Zotlabs/Widget/Cdav.php @@ -1,8 +1,12 @@ <?php -namespace Zotlabs\Widget; - +/** + * * Name: CalDAV/CardDAV tools + * * Description: A widget with various CalDAV and CardDAV tools + * * Requires: cdav + */ +namespace Zotlabs\Widget; class Cdav { @@ -164,7 +168,7 @@ class Cdav { 'uri' => $sabreabook['uri'], 'displayname' => $sabreabook['{DAV:}displayname'], 'id' => $sabreabook['id'] - + ]; } diff --git a/Zotlabs/Widget/Chatroom_list.php b/Zotlabs/Widget/Chatroom_list.php index e2aad0e05..d80e40bf9 100644 --- a/Zotlabs/Widget/Chatroom_list.php +++ b/Zotlabs/Widget/Chatroom_list.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Chatroom list + * * Description: A menu with links to your chatrooms + * * Requires: chat, channel, articles, cards, wiki + */ + namespace Zotlabs\Widget; class Chatroom_list { diff --git a/Zotlabs/Widget/Chatroom_members.php b/Zotlabs/Widget/Chatroom_members.php index 8ed77fb3c..0846192ce 100644 --- a/Zotlabs/Widget/Chatroom_members.php +++ b/Zotlabs/Widget/Chatroom_members.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Chatroom members + * * Description: A widget that shows members of a chatroom + * * Requires: chat + */ + namespace Zotlabs\Widget; class Chatroom_members { diff --git a/Zotlabs/Widget/Clock.php b/Zotlabs/Widget/Clock.php index b63b5f748..3b9751cc5 100644 --- a/Zotlabs/Widget/Clock.php +++ b/Zotlabs/Widget/Clock.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Clock + * * Description: A simple widget that shows the current time + */ + namespace Zotlabs\Widget; class Clock { diff --git a/Zotlabs/Widget/Collections.php b/Zotlabs/Widget/Collections.php deleted file mode 100644 index ad1a10f4b..000000000 --- a/Zotlabs/Widget/Collections.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Zotlabs\Widget; - -use Zotlabs\Lib\AccessList; - -class Collections { - - function widget($args) { - - if(argc() < 2) - // return; - - $mode = ((array_key_exists('mode',$args)) ? $args['mode'] : 'conversation'); - switch($mode) { - case 'conversation': - $every = argv(0); - $each = argv(0); - $edit = true; - $current = $_REQUEST['gid']; - $abook_id = 0; - $wmode = 0; - break; - case 'connections': - $every = 'connections'; - $each = 'group'; - $edit = true; - $current = $_REQUEST['gid']; - $abook_id = 0; - $wmode = 0; - case 'groups': - $every = 'connections'; - $each = argv(0); - $edit = false; - $current = intval(argv(1)); - $abook_id = 0; - $wmode = 1; - break; - case 'abook': - $every = 'connections'; - $each = 'group'; - $edit = false; - $current = 0; - $abook_id = \App::$poi['abook_xchan']; - $wmode = 1; - break; - default: - return ''; - break; - } - - return AccessList::widget($every, $each, $edit, $current, $abook_id, $wmode); - } -} diff --git a/Zotlabs/Widget/Common_friends.php b/Zotlabs/Widget/Common_friends.php index a67b9312c..6024f82f5 100644 --- a/Zotlabs/Widget/Common_friends.php +++ b/Zotlabs/Widget/Common_friends.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Common friends + * * Description: Display common friends to visitors + * * Requires: channel, articles, cards, wiki + */ + namespace Zotlabs\Widget; require_once('include/contact_widgets.php'); @@ -8,7 +14,7 @@ class Common_friends { function widget($arr) { - if((! \App::$profile['profile_uid']) + if((! \App::$profile['profile_uid']) || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_contacts'))) { return ''; } diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php index 97323ea8c..11d9c4715 100644 --- a/Zotlabs/Widget/Cover_photo.php +++ b/Zotlabs/Widget/Cover_photo.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Cover photo + * * Description: Display a cover photo in the banner region + * * Requires: disabled_for_pdledit_gui + */ + namespace Zotlabs\Widget; class Cover_photo { diff --git a/Zotlabs/Widget/Design_tools.php b/Zotlabs/Widget/Design_tools.php index a15c0c98d..0f94577d8 100644 --- a/Zotlabs/Widget/Design_tools.php +++ b/Zotlabs/Widget/Design_tools.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Design tools + * * Description: Links to useful tools for webpages + * * Requires: webpages + */ + namespace Zotlabs\Widget; class Design_tools { @@ -11,4 +17,4 @@ class Design_tools { return EMPTY_STR; } -}
\ No newline at end of file +} diff --git a/Zotlabs/Widget/Dirsort.php b/Zotlabs/Widget/Dirsort.php index 2fb38b7df..569782bb9 100644 --- a/Zotlabs/Widget/Dirsort.php +++ b/Zotlabs/Widget/Dirsort.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Dirsort + * * Description: Various options to provide different vies of the directory + * * Requires: directory + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Libzotdir; diff --git a/Zotlabs/Widget/Dirtags.php b/Zotlabs/Widget/Dirtags.php index 246c47dde..183c2f20f 100644 --- a/Zotlabs/Widget/Dirtags.php +++ b/Zotlabs/Widget/Dirtags.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Directory tags + * * Description: Show directory tags in a cloud + * * Requires: directory + */ + namespace Zotlabs\Widget; class Dirtags { diff --git a/Zotlabs/Widget/Eventstools.php b/Zotlabs/Widget/Eventstools.php deleted file mode 100644 index 7efd3f72e..000000000 --- a/Zotlabs/Widget/Eventstools.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Zotlabs\Widget; - -class Eventstools { - - function widget($arr) { - - if(! local_channel()) - return; - - return replace_macros(get_markup_template('events_tools_side.tpl'), array( - '$title' => t('Events Tools'), - '$export' => t('Export Calendar'), - '$import' => t('Import Calendar'), - '$submit' => t('Submit') - )); - } -} diff --git a/Zotlabs/Widget/Filer.php b/Zotlabs/Widget/Filer.php index 5d6f96a87..6c5ac47a9 100644 --- a/Zotlabs/Widget/Filer.php +++ b/Zotlabs/Widget/Filer.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Saved folders + * * Description: A menu containing saved folders + * * Requires: network + */ + namespace Zotlabs\Widget; require_once('include/contact_widgets.php'); @@ -10,7 +16,6 @@ class Filer { if(! local_channel()) return ''; - $selected = ((x($_REQUEST,'file')) ? $_REQUEST['file'] : ''); $terms = array(); diff --git a/Zotlabs/Widget/Findpeople.php b/Zotlabs/Widget/Findpeople.php index f450b96ae..45d62bb7f 100644 --- a/Zotlabs/Widget/Findpeople.php +++ b/Zotlabs/Widget/Findpeople.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Find channels + * * Description: A simple form to search for channels in the directory + */ + namespace Zotlabs\Widget; require_once('include/contact_widgets.php'); diff --git a/Zotlabs/Widget/Follow.php b/Zotlabs/Widget/Follow.php index c4aecc8e1..2a0abb027 100644 --- a/Zotlabs/Widget/Follow.php +++ b/Zotlabs/Widget/Follow.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Follow + * * Description: A simple form which allows you to enter an address and send a follow request + */ + namespace Zotlabs\Widget; @@ -24,7 +29,7 @@ class Follow { else { $abook_usage_message = ''; } - + return replace_macros(get_markup_template('follow.tpl'),array( '$connect' => t('Add New Connection'), '$desc' => t('Enter channel address'), diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php index 2af7347f1..c40556273 100644 --- a/Zotlabs/Widget/Forums.php +++ b/Zotlabs/Widget/Forums.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Forums + * * Description: A list of forum channels with unseen item counts + */ + namespace Zotlabs\Widget; class Forums { @@ -21,35 +26,7 @@ class Forums { $unseen = 1; $perms_sql = item_permissions_sql(local_channel()) . item_normal(); - - $xf = false; - - $x1 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'send_stream' and v = '0'", - intval(local_channel()) - ); - 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) { - $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 "); - - + $sql_extra = " 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 and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name $limit ", intval(local_channel()) diff --git a/Zotlabs/Widget/Fullprofile.php b/Zotlabs/Widget/Fullprofile.php index e8ed13811..edff88e31 100644 --- a/Zotlabs/Widget/Fullprofile.php +++ b/Zotlabs/Widget/Fullprofile.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Full profile + * * Description: Profile card with extended profile info + * * Requires: channel, articles, cards, wiki, cloud, photos + */ + namespace Zotlabs\Widget; class Fullprofile { diff --git a/Zotlabs/Widget/Helpindex.php b/Zotlabs/Widget/Helpindex.php index 6c8748194..fbcd8c8b2 100644 --- a/Zotlabs/Widget/Helpindex.php +++ b/Zotlabs/Widget/Helpindex.php @@ -1,11 +1,18 @@ <?php +/** + * * Name: Help index + * * Description: Help pages index + */ + namespace Zotlabs\Widget; class Helpindex { function widget($arr) { + require_once('include/help.php'); + $o .= '<div class="widget">'; $level_0 = get_help_content('sitetoc'); diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 91335fd76..7b1fe817d 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -1,5 +1,12 @@ <?php +/** + * * Name: HQ Controls + * * Description: Control buttons for the HQ module + * * Author: Mario Vavti + * * Requires: hq + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Apps; diff --git a/Zotlabs/Widget/Item.php b/Zotlabs/Widget/Item.php index 273d5649c..9fd703dfe 100644 --- a/Zotlabs/Widget/Item.php +++ b/Zotlabs/Widget/Item.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Item + * * Description: Display a webpage by title or mid, + * * Requires: channel, articles, cards, wiki + */ + namespace Zotlabs\Widget; require_once('include/security.php'); @@ -35,7 +41,7 @@ class Item { ); } else { - $r = q("select * from item where mid = '%s' and uid = %d and item_type = " + $r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1", dbesc($arr['mid']), intval($channel_id) diff --git a/Zotlabs/Widget/Menu_preview.php b/Zotlabs/Widget/Menu_preview.php index 51218f6cf..ddeb4d12c 100644 --- a/Zotlabs/Widget/Menu_preview.php +++ b/Zotlabs/Widget/Menu_preview.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Menu preview + * * Description: Shows a preview of the current menu + * * Requires: mitem + */ + namespace Zotlabs\Widget; require_once('include/menu.php'); diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 71f4bd310..d045ae85b 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -1,5 +1,13 @@ <?php +/** + * * Name: HQ Messages + * * Description: Quick access to messages, direct messages, starred messages (if enabled) and notifications + * * Author: Mario Vavti + * * Requires: hq + */ + + namespace Zotlabs\Widget; use App; @@ -17,8 +25,8 @@ class Messages { $tpl = get_markup_template('messages_widget.tpl'); $o = replace_macros($tpl, [ - '$entries' => $page['entries'], - '$offset' => $page['offset'], + '$entries' => $page['entries'] ?? [], + '$offset' => $page['offset'] ?? 0, '$feature_star' => feature_enabled(local_channel(), 'star_posts'), '$strings' => [ 'messages_title' => t('Public and restricted messages'), @@ -37,11 +45,11 @@ class Messages { if (!local_channel()) return; - if ($options['offset'] == -1) { + if (isset($options['offset']) && $options['offset'] == -1) { return; } - if ($options['type'] == 'notification') { + if (isset($options['type']) && $options['type'] == 'notification') { return self::get_notices_page($options); } @@ -103,13 +111,20 @@ class Messages { if (!$summary) { $summary = $item['summary']; } + if (!$summary) { - $summary = htmlentities(html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true), ENT_QUOTES, 'UTF-8', false); + $summary = html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true); + if ($summary) { + $summary = htmlentities($summary, ENT_QUOTES, 'UTF-8', false); + } } + if (!$summary) { $summary = '...'; } - $summary = substr_words($summary, 68); + else { + $summary = substr_words($summary, 68); + } switch(intval($item['item_private'])) { case 1: diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php index 224f7a8a2..70a858fb0 100644 --- a/Zotlabs/Widget/Newmember.php +++ b/Zotlabs/Widget/Newmember.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: New member + * * Description: Display useful links for new members to help them get started + */ + namespace Zotlabs\Widget; class Newmember { @@ -29,7 +34,7 @@ class Newmember { $options = [ t('Profile Creation'), - [ + [ 'profile_photo' => t('Upload profile photo'), 'cover_photo' => t('Upload cover photo'), 'profiles' => t('Edit your profile'), @@ -84,4 +89,4 @@ class Newmember { } - + diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php index 659b62390..2e8e04e93 100644 --- a/Zotlabs/Widget/Notes.php +++ b/Zotlabs/Widget/Notes.php @@ -1,5 +1,13 @@ <?php +/** + * * Name: Notes + * * Description: A simple notes widget, requires the Notes App + * * Author: Mike Macgirvin + * * Author: Mario Vavti + * * Maintainer: Mario Vavti + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Apps; @@ -33,9 +41,6 @@ class Notes { ] )); - - - return $o; } } diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index a818ae40a..0e02d5cc1 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Notifications + * * Description: Shows all kind of notifications + * * Author: Mario Vavti + */ + namespace Zotlabs\Widget; class Notifications { diff --git a/Zotlabs/Widget/Permcats.php b/Zotlabs/Widget/Permcats.php index a908f6220..9226b3c71 100644 --- a/Zotlabs/Widget/Permcats.php +++ b/Zotlabs/Widget/Permcats.php @@ -1,5 +1,12 @@ <?php +/** + * * Name: Contact roles + * * Description: Display a menu with all defined contact roles and contacts which are assigned to the selected role + * * Author: Mario Vavti + * * Requires: permcats + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Permcat; diff --git a/Zotlabs/Widget/Photo.php b/Zotlabs/Widget/Photo.php index 10031f028..5ad6c604c 100644 --- a/Zotlabs/Widget/Photo.php +++ b/Zotlabs/Widget/Photo.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Photo + * * Description: Displays a single photo + */ + + namespace Zotlabs\Widget; diff --git a/Zotlabs/Widget/Photo_albums.php b/Zotlabs/Widget/Photo_albums.php index 6df8ddf3c..2ce916048 100644 --- a/Zotlabs/Widget/Photo_albums.php +++ b/Zotlabs/Widget/Photo_albums.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Photo albums + * * Description: Displays a menu with links to existing photo albums + * * Requires: photos + */ + namespace Zotlabs\Widget; require_once('include/photos.php'); diff --git a/Zotlabs/Widget/Photo_rand.php b/Zotlabs/Widget/Photo_rand.php index af80a3b9f..cfe026b19 100644 --- a/Zotlabs/Widget/Photo_rand.php +++ b/Zotlabs/Widget/Photo_rand.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Random photo + * * Description: Display a random photo + */ + namespace Zotlabs\Widget; require_once('include/photos.php'); @@ -40,15 +45,15 @@ class Photo_rand { if(strpos($url, 'http') !== 0) return ''; - + if(array_key_exists('style', $arr) && isset($arr['style'])) $style = $arr['style']; - + // ensure they can't sneak in an eval(js) function if(strpos($style,'(') !== false) return ''; - + $url = zid($url); $o = '<div class="widget">'; diff --git a/Zotlabs/Widget/Pinned.php b/Zotlabs/Widget/Pinned.php index 66d06bbd3..83036e98c 100644 --- a/Zotlabs/Widget/Pinned.php +++ b/Zotlabs/Widget/Pinned.php @@ -1,11 +1,14 @@ <?php namespace Zotlabs\Widget; -/* - * Show pinned content - * +/** + * * Name: Pinned items + * * Description: Display pinned items + * * Author: Max Kostikov + * * Requires: disabled_for_pdledit_gui */ + class Pinned { private $allowed_types = 0; diff --git a/Zotlabs/Widget/Portfolio.php b/Zotlabs/Widget/Portfolio.php index 0cd043246..a06f56e30 100644 --- a/Zotlabs/Widget/Portfolio.php +++ b/Zotlabs/Widget/Portfolio.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Portfolio + * * Description: Display a photo album in a portfolio style + * * Requires: channel, articles, cards, wiki + */ + namespace Zotlabs\Widget; require_once('include/attach.php'); @@ -8,11 +14,9 @@ class Portfolio { function widget($args) { - $owner_uid = \App::$profile_uid; $sql_extra = permissions_sql($owner_uid); - if(! perm_is_allowed($owner_uid,get_observer_hash(),'view_storage')) return ''; @@ -112,7 +116,7 @@ class Portfolio { '$upload_form' => $upload_form, '$usage' => $usage_message )); - + return $o; } } diff --git a/Zotlabs/Widget/Privacygroups.php b/Zotlabs/Widget/Privacygroups.php index a6b16c552..62f343ea6 100644 --- a/Zotlabs/Widget/Privacygroups.php +++ b/Zotlabs/Widget/Privacygroups.php @@ -1,5 +1,12 @@ <?php +/** + * * Name: Privacy Groups + * * Description: Display a menu with links to existing privacy groups + * * Requires: group + */ + + namespace Zotlabs\Widget; use Zotlabs\Lib\AccessList; diff --git a/Zotlabs/Widget/Profile.php b/Zotlabs/Widget/Profile.php index 0e5444a56..a0bb1a66a 100644 --- a/Zotlabs/Widget/Profile.php +++ b/Zotlabs/Widget/Profile.php @@ -1,5 +1,12 @@ <?php +/** + * * Name: Profile + * * Description: Your profile card + * * Requires: channel, articles, cards, wiki, cloud, photos + */ + + namespace Zotlabs\Widget; use App; diff --git a/Zotlabs/Widget/Pubsites.php b/Zotlabs/Widget/Pubsites.php deleted file mode 100644 index 958ba68c2..000000000 --- a/Zotlabs/Widget/Pubsites.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Zotlabs\Widget; - -class Pubsites { - - // used by site ratings pages to provide a return link - - function widget($arr) { - if(\App::$poi) - return; - return '<div class="widget"><ul class="nav nav-pills"><li><a href="pubsites">' . t('Public Hubs') . '</a></li></ul></div>'; - } -} - - diff --git a/Zotlabs/Widget/Pubtagcloud.php b/Zotlabs/Widget/Pubtagcloud.php index 826e3e6ae..db7ea02e7 100644 --- a/Zotlabs/Widget/Pubtagcloud.php +++ b/Zotlabs/Widget/Pubtagcloud.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Public stream tags + * * Description: Display public stream tags in a cloud + */ + namespace Zotlabs\Widget; class Pubtagcloud { diff --git a/Zotlabs/Widget/Random_block.php b/Zotlabs/Widget/Random_block.php index 465a51f97..9052bea03 100644 --- a/Zotlabs/Widget/Random_block.php +++ b/Zotlabs/Widget/Random_block.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Random block + * * Description: Display a random block item + */ + namespace Zotlabs\Widget; class Random_block { diff --git a/Zotlabs/Widget/Rating.php b/Zotlabs/Widget/Rating.php index 5e09f457b..20c27ff1c 100644 --- a/Zotlabs/Widget/Rating.php +++ b/Zotlabs/Widget/Rating.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Rating + * * Description: Deprecated rating tool + * * Requires: disabled_for_pdledit_gui + */ + namespace Zotlabs\Widget; class Rating { diff --git a/Zotlabs/Widget/Savedsearch.php b/Zotlabs/Widget/Savedsearch.php index 378c27139..660fd6d81 100644 --- a/Zotlabs/Widget/Savedsearch.php +++ b/Zotlabs/Widget/Savedsearch.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Saved searches + * * Description: A search form which also displays saved searches if the feature is enabled + * * Requires: network + */ + namespace Zotlabs\Widget; class Savedsearch { diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 4d0f1d2dd..ef269d84b 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Settings menu + * * Description: Display the channel settings menu + */ + namespace Zotlabs\Widget; class Settings_menu { diff --git a/Zotlabs/Widget/Shortprofile.php b/Zotlabs/Widget/Shortprofile.php deleted file mode 100644 index 9c2a46e75..000000000 --- a/Zotlabs/Widget/Shortprofile.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Zotlabs\Widget; - -class Shortprofile { - - function widget($arr) { - - if(! \App::$profile['profile_uid']) - return; - - $block = observer_prohibited(); - - return profile_sidebar(\App::$profile, $block, true, true); - } - -} - diff --git a/Zotlabs/Widget/Sitesearch.php b/Zotlabs/Widget/Sitesearch.php index b3a25d76a..a5f1a5935 100644 --- a/Zotlabs/Widget/Sitesearch.php +++ b/Zotlabs/Widget/Sitesearch.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Search + * * Description: A search form + * * Requires: search, network, channel + */ + namespace Zotlabs\Widget; diff --git a/Zotlabs/Widget/Suggestedchats.php b/Zotlabs/Widget/Suggestedchats.php index 7df42944d..75df0c9e6 100644 --- a/Zotlabs/Widget/Suggestedchats.php +++ b/Zotlabs/Widget/Suggestedchats.php @@ -1,14 +1,18 @@ <?php +/** + * * Name: Suggested chats + * * Description: A menu with chatroom suggestions + * * Requires: disabled_due_to_reasons + */ + + namespace Zotlabs\Widget; class Suggestedchats { function widget($arr) { - if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) - return ''; - // There are reports that this tool does not ever remove chatrooms on dead sites, // and also will happily link to private chats which you cannot enter. // For those reasons, it will be disabled until somebody decides it's worth diff --git a/Zotlabs/Widget/Suggestions.php b/Zotlabs/Widget/Suggestions.php index b4f384e9d..e7d23bda4 100644 --- a/Zotlabs/Widget/Suggestions.php +++ b/Zotlabs/Widget/Suggestions.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Suggestions + * * Description: Display suggestions for new contacts + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Apps; @@ -12,7 +17,7 @@ class Suggestions { function widget($arr) { - if((! local_channel()) || (! Apps::system_app_installed(local_channel(), 'Suggest Channels'))) + if(! local_channel()) return EMPTY_STR; $r = suggestion_query(local_channel(),get_observer_hash(),0,20); @@ -23,14 +28,14 @@ class Suggestions { $arr = array(); - // Get two random entries from the top 20 returned. + // Get four random entries from the top 20 returned. // We'll grab the first one and the one immediately following. // This will throw some entropy intot he situation so you won't // be looking at the same two mug shots every time the widget runs - $index = ((count($r) > 2) ? mt_rand(0,count($r) - 2) : 0); + $index = ((count($r) > 4) ? mt_rand(0,count($r) - 4) : 0); - for($x = $index; $x <= ($index+1); $x ++) { + for($x = $index; $x <= ($index+3); $x ++) { $rr = $r[$x]; if(! $rr['xchan_url']) break; diff --git a/Zotlabs/Widget/Tagcloud.php b/Zotlabs/Widget/Tagcloud.php index f79bd59ad..00456f24f 100644 --- a/Zotlabs/Widget/Tagcloud.php +++ b/Zotlabs/Widget/Tagcloud.php @@ -2,6 +2,11 @@ namespace Zotlabs\Widget; +/** + * * Name: Tag cloud + * * Description: Display hashtags of your network items in a cloud + * * Requires: network, hq + */ class Tagcloud { diff --git a/Zotlabs/Widget/Tagcloud_wall.php b/Zotlabs/Widget/Tagcloud_wall.php index 7cff6ce09..20def4ab1 100644 --- a/Zotlabs/Widget/Tagcloud_wall.php +++ b/Zotlabs/Widget/Tagcloud_wall.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Tag cloud wall + * * Description: Display hashtags of your channel wall items in a cloud if the feature is enabled + * * Requires: channel + */ + namespace Zotlabs\Widget; class Tagcloud_wall { diff --git a/Zotlabs/Widget/Tasklist.php b/Zotlabs/Widget/Tasklist.php index 56342bd17..5ecfd5a27 100644 --- a/Zotlabs/Widget/Tasklist.php +++ b/Zotlabs/Widget/Tasklist.php @@ -1,8 +1,11 @@ <?php -namespace Zotlabs\Widget; +/** + * * Name: Task list + * * Description: Simple task list mangager + */ -require_once('include/event.php'); +namespace Zotlabs\Widget; class Tasklist { @@ -20,7 +23,7 @@ class Tasklist { } </script>'; - $o .= '<div class="widget">' . '<h3>' . t('Tasks') . '</h3><div class="tasklist-tasks">'; + $o .= '<div class="widget">' . '<h3>' . t('Tasks') . '</h3><div class="tasklist-tasks mb-1">'; $o .= '</div><form id="tasklist-new-form" action="" ><input class="form-control" id="tasklist-new-summary" type="text" name="summary" value="" /></form>'; $o .= '</div>'; return $o; diff --git a/Zotlabs/Widget/Tokens.php b/Zotlabs/Widget/Tokens.php index 8c31003fc..69452d628 100644 --- a/Zotlabs/Widget/Tokens.php +++ b/Zotlabs/Widget/Tokens.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Tokens + * * Description: Display a menu with links to existing guest access tokens + * * Requires: tokens + */ + namespace Zotlabs\Widget; class Tokens { diff --git a/Zotlabs/Widget/Vcard.php b/Zotlabs/Widget/Vcard.php index cab05dfdd..25bb8592c 100644 --- a/Zotlabs/Widget/Vcard.php +++ b/Zotlabs/Widget/Vcard.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Vcard + * * Description: Your default profile card + */ + namespace Zotlabs\Widget; class Vcard { diff --git a/Zotlabs/Widget/Website_portation_tools.php b/Zotlabs/Widget/Website_portation_tools.php index 1cf3bb78a..61fe48169 100644 --- a/Zotlabs/Widget/Website_portation_tools.php +++ b/Zotlabs/Widget/Website_portation_tools.php @@ -1,7 +1,12 @@ <?php -namespace Zotlabs\Widget; +/** + * * Name: Website import/export + * * Description: Tools to import and export websites + * * Requires: website + */ +namespace Zotlabs\Widget; class Website_portation_tools { diff --git a/Zotlabs/Widget/Wiki_list.php b/Zotlabs/Widget/Wiki_list.php index 64c988ee7..217ab8706 100644 --- a/Zotlabs/Widget/Wiki_list.php +++ b/Zotlabs/Widget/Wiki_list.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Wiki list + * * Description: A list of existing wikis + */ + namespace Zotlabs\Widget; class Wiki_list { diff --git a/Zotlabs/Widget/Wiki_page_history.php b/Zotlabs/Widget/Wiki_page_history.php index dbb322dc3..3c9f5ed1a 100644 --- a/Zotlabs/Widget/Wiki_page_history.php +++ b/Zotlabs/Widget/Wiki_page_history.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Wiki page history + * * Description: History of an existing wiki page + * * Requires: wiki + */ + namespace Zotlabs\Widget; class Wiki_page_history { @@ -10,7 +16,7 @@ class Wiki_page_history { $resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : ''); $pageHistory = \Zotlabs\Lib\NativeWikiPage::page_history([ - 'channel_id' => \App::$profile_uid, + 'channel_id' => \App::$profile_uid, 'observer_hash' => get_observer_hash(), 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php index dee0a2229..ece712334 100644 --- a/Zotlabs/Widget/Wiki_pages.php +++ b/Zotlabs/Widget/Wiki_pages.php @@ -1,5 +1,11 @@ <?php +/** + * * Name: Wiki pages + * * Description: A list of existing pages of a wiki + * * Requires: wiki + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\NativeWiki; @@ -34,7 +40,7 @@ class Wiki_pages { '$addnew' => t('Add new page'), '$typelock' => $typelock, '$lockedtype' => $w['mimeType'], - '$mimetype' => mimetype_select(0,$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'], @@ -91,7 +97,7 @@ class Wiki_pages { '$addnew' => t('Add new page'), '$typelock' => $typelock, '$lockedtype' => $w['mimeType'], - '$mimetype' => mimetype_select(0,$w['mimeType'], + '$mimetype' => mimetype_select(0,$w['mimeType'], [ 'text/markdown' => t('Markdown'), 'text/bbcode' => t('BBcode'), 'text/plain' => t('Text') ]), '$pageName' => array('pageName', t('Page name')), '$refresh' => $arr['refresh'], diff --git a/Zotlabs/Widget/Zcard.php b/Zotlabs/Widget/Zcard.php index 12e53eaab..35362c50e 100644 --- a/Zotlabs/Widget/Zcard.php +++ b/Zotlabs/Widget/Zcard.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Zcard + * * Description: Your default profile card including your cover photo + */ + namespace Zotlabs\Widget; class Zcard { |