diff options
54 files changed, 567 insertions, 660 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 860a799ef..aa7e2282d 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -303,7 +303,7 @@ class Apps { 'Admin' => t('Site Admin'), 'Report Bug' => t('Report Bug'), 'View Bookmarks' => t('View Bookmarks'), - 'My Chatrooms' => t('My Chatrooms'), + 'Chatrooms' => t('Chatrooms'), 'Connections' => t('Connections'), 'Remote Diagnostics' => t('Remote Diagnostics'), 'Suggest Channels' => t('Suggest Channels'), @@ -722,6 +722,9 @@ class Apps { ); if($r) { + $hookinfo = Array('uid'=>$uid,'deleted'=>$deleted,'cats'=>$cats,'apps'=>$r); + call_hooks('app_list',$hookinfo); + $r = $hookinfo['apps']; for($x = 0; $x < count($r); $x ++) { if(! $r[$x]['app_system']) $r[$x]['type'] = 'personal'; diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php index 11025ce6e..05b4495fc 100644 --- a/Zotlabs/Module/Apps.php +++ b/Zotlabs/Module/Apps.php @@ -50,8 +50,8 @@ class Apps extends \Zotlabs\Web\Controller { '$title' => (($available) ? t('Available Apps') : t('Installed Apps')), '$apps' => $apps, '$authed' => ((local_channel()) ? true : false), - '$manage' => (($available) ? '' : t('Manage apps')), - '$create' => (($mode == 'edit') ? t('Create new app') : '') + '$manage' => (($available) ? '' : t('Manage Apps')), + '$create' => (($mode == 'edit') ? t('Create Custom App') : '') )); } diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index e1f0b4ab0..7af1ab6b8 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -1,12 +1,17 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\PermissionDescription; + require_once('include/channel.php'); require_once('include/conversation.php'); require_once('include/acl_selectors.php'); -class Articles extends \Zotlabs\Web\Controller { +class Articles extends Controller { function init() { @@ -25,22 +30,27 @@ class Articles extends \Zotlabs\Web\Controller { return login(); } - if(! \App::$profile) { + if(! App::$profile) { notice( t('Requested profile is not available.') . EOL ); - \App::$error = 404; + App::$error = 404; return; } - if(! feature_enabled(\App::$profile_uid,'articles')) { - return; + if(! Apps::system_app_installed(App::$profile_uid, 'Articles')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Articles App (Not Installed):</b><br>'; + $o .= t('Create interactive articles'); + return $o; } - nav_set_selected(t('Articles')); + nav_set_selected('Articles'); head_add_link([ 'rel' => 'alternate', 'type' => 'application/json+oembed', - 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), + 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string), 'title' => 'oembed' ]); @@ -48,7 +58,7 @@ class Articles extends \Zotlabs\Web\Controller { $category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : ''); if($category) { - $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY)); + $sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'],'item', $category, TERM_CATEGORY)); } $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); @@ -58,11 +68,11 @@ class Articles extends \Zotlabs\Web\Controller { $selected_card = ((argc() > 2) ? argv(2) : ''); - $_SESSION['return_url'] = \App::$query_string; + $_SESSION['return_url'] = App::$query_string; $uid = local_channel(); - $owner = \App::$profile_uid; - $observer = \App::get_observer(); + $owner = App::$profile_uid; + $observer = App::get_observer(); $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); @@ -100,7 +110,7 @@ class Articles extends \Zotlabs\Web\Controller { 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => (($is_owner) ? populate_acl($channel_acl, false, - \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), + PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), 'visitor' => true, @@ -130,8 +140,8 @@ class Articles extends \Zotlabs\Web\Controller { } $itemspage = get_pconfig(local_channel(),'system','itemspage'); - \App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); + App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start'])); $sql_extra = item_permissions_sql($owner); @@ -179,7 +189,7 @@ class Articles extends \Zotlabs\Web\Controller { WHERE item.uid = %d $item_normal AND item.parent IN ( %s ) $sql_extra $sql_extra2 ", - intval(\App::$profile['profile_uid']), + intval(App::$profile['profile_uid']), dbesc($parents_str) ); if($items) { diff --git a/Zotlabs/Module/Bookmarks.php b/Zotlabs/Module/Bookmarks.php index e147ffe6c..cea0d9759 100644 --- a/Zotlabs/Module/Bookmarks.php +++ b/Zotlabs/Module/Bookmarks.php @@ -71,7 +71,6 @@ class Bookmarks extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - //$o = profile_tabs($a,true,$channel['channel_address']); $o = ''; $o .= '<div class="generic-content-wrapper-styled">'; diff --git a/Zotlabs/Module/Cal.php b/Zotlabs/Module/Cal.php index c8403e979..87c13ef4e 100644 --- a/Zotlabs/Module/Cal.php +++ b/Zotlabs/Module/Cal.php @@ -88,9 +88,6 @@ class Cal extends \Zotlabs\Web\Controller { $o = ''; - //$tabs = profile_tabs($a, True, $channel['channel_address']); - $tabs = ''; - $mode = 'view'; $y = 0; $m = 0; @@ -347,8 +344,7 @@ class Cal extends \Zotlabs\Web\Controller { '$next' => t('Next'), '$today' => t('Today'), '$form' => $form, - '$expandform' => ((x($_GET,'expandform')) ? true : false), - '$tabs' => $tabs + '$expandform' => ((x($_GET,'expandform')) ? true : false) )); if (x($_GET,'id')){ echo $o; killme(); } diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index f196988a2..78cbad5fd 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -1,12 +1,16 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\PermissionDescription; + require_once('include/channel.php'); require_once('include/conversation.php'); require_once('include/acl_selectors.php'); - -class Cards extends \Zotlabs\Web\Controller { +class Cards extends Controller { function init() { @@ -29,22 +33,27 @@ class Cards extends \Zotlabs\Web\Controller { return login(); } - if(! \App::$profile) { + if(! App::$profile) { notice( t('Requested profile is not available.') . EOL ); - \App::$error = 404; + App::$error = 404; return; } - if(! feature_enabled(\App::$profile_uid, 'cards')) { - return; + if(! Apps::system_app_installed(App::$profile_uid, 'Cards')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Cards App (Not Installed):</b><br>'; + $o .= t('Create personal planning cards'); + return $o; } - nav_set_selected(t('Cards')); + nav_set_selected('Cards'); head_add_link([ 'rel' => 'alternate', 'type' => 'application/json+oembed', - 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), + 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string), 'title' => 'oembed' ]); @@ -52,7 +61,7 @@ class Cards extends \Zotlabs\Web\Controller { $category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : ''); if($category) { - $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); + $sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); } @@ -60,11 +69,11 @@ class Cards extends \Zotlabs\Web\Controller { $selected_card = ((argc() > 2) ? argv(2) : ''); - $_SESSION['return_url'] = \App::$query_string; + $_SESSION['return_url'] = App::$query_string; $uid = local_channel(); - $owner = \App::$profile_uid; - $observer = \App::get_observer(); + $owner = App::$profile_uid; + $observer = App::get_observer(); $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); @@ -101,8 +110,8 @@ class Cards extends \Zotlabs\Web\Controller { 'nickname' => $channel['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl, false, - \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), + 'acl' => (($is_owner) ? populate_acl($channel_acl, false, + PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), 'visitor' => true, @@ -132,8 +141,8 @@ class Cards extends \Zotlabs\Web\Controller { $itemspage = get_pconfig(local_channel(),'system','itemspage'); - \App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); + App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start'])); $sql_extra = item_permissions_sql($owner); @@ -171,7 +180,7 @@ class Cards extends \Zotlabs\Web\Controller { WHERE item.uid = %d $item_normal AND item.parent IN ( %s ) $sql_extra $sql_extra2 ", - intval(\App::$profile['profile_uid']), + intval(App::$profile['profile_uid']), dbesc($parents_str) ); if($items) { diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php index 6737ac4ee..bff308dfa 100644 --- a/Zotlabs/Module/Cdav.php +++ b/Zotlabs/Module/Cdav.php @@ -1,12 +1,16 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; + require_once('include/event.php'); require_once('include/auth.php'); require_once('include/security.php'); -class Cdav extends \Zotlabs\Web\Controller { +class Cdav extends Controller { function init() { @@ -126,8 +130,18 @@ class Cdav extends \Zotlabs\Web\Controller { $auth->setRealm(ucfirst(\Zotlabs\Lib\System::get_platform_name()) . 'CalDAV/CardDAV'); if (local_channel()) { + logger('loggedin'); - $channel = \App::get_channel(); + + if((argv(1) == 'calendars') && (!Apps::system_app_installed(local_channel(), 'CalDAV'))) { + killme(); + } + + if((argv(1) == 'addressbooks') && (!Apps::system_app_installed(local_channel(), 'CardDAV'))) { + killme(); + } + + $channel = App::get_channel(); $auth->setCurrentUser($channel['channel_address']); $auth->channel_id = $channel['channel_id']; $auth->channel_hash = $channel['channel_hash']; @@ -161,12 +175,15 @@ class Cdav extends \Zotlabs\Web\Controller { $nodes = [ // /principals new \Sabre\CalDAV\Principal\Collection($principalBackend), + // /calendars new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend), + // /addressbook - new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend), + new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend) ]; + // The object tree needs in turn to be passed to the server class $server = new \Sabre\DAV\Server($nodes); @@ -204,7 +221,15 @@ class Cdav extends \Zotlabs\Web\Controller { if(! local_channel()) return; - $channel = \App::get_channel(); + if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) { + return; + } + + if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) { + return; + } + + $channel = App::get_channel(); $principalUri = 'principals/' . $channel['channel_address']; if(!cdav_principal($principalUri)) @@ -807,7 +832,25 @@ class Cdav extends \Zotlabs\Web\Controller { if(!local_channel()) return; - $channel = \App::get_channel(); + if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>CalDAV App (Not Installed):</b><br>'; + $o .= t('CalDAV capable calendar'); + return $o; + } + + if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>CardDAV App (Not Installed):</b><br>'; + $o .= t('CalDAV capable addressbook'); + return $o; + } + + $channel = App::get_channel(); $principalUri = 'principals/' . $channel['channel_address']; $pdo = \DBA::$dba->db; @@ -874,7 +917,7 @@ class Cdav extends \Zotlabs\Web\Controller { $o .= replace_macros(get_markup_template('cdav_calendar.tpl'), [ '$sources' => $sources, '$color' => $color, - '$lang' => \App::$language, + '$lang' => App::$language, '$first_day' => $first_day, '$prev' => t('Previous'), '$next' => t('Next'), diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 8941faf56..74fdc1cb4 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -197,7 +197,8 @@ class Channel extends Controller { $sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG); } else { - $sql_extra .= sprintf(" AND item.body like '%s' ", + $sql_extra .= sprintf(" AND (item.body like '%s' OR item.title like '%s') ", + dbesc(protect_sprintf('%' . $search . '%')), dbesc(protect_sprintf('%' . $search . '%')) ); } diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index 378c9f4dd..551dc5e2a 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -1,13 +1,19 @@ <?php /** @file */ -namespace Zotlabs\Module; +namespace Zotlabs\Module; + +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\Chatroom; +use Zotlabs\Access\AccessList; -require_once('include/bookmarks.php'); -use \Zotlabs\Lib as Zlib; -class Chat extends \Zotlabs\Web\Controller { +require_once('include/bookmarks.php'); + +class Chat extends Controller { function init() { @@ -16,7 +22,7 @@ class Chat extends \Zotlabs\Web\Controller { $which = argv(1); if(! $which) { if(local_channel()) { - $channel = \App::get_channel(); + $channel = App::get_channel(); if($channel && $channel['channel_address']) $which = $channel['channel_address']; } @@ -27,7 +33,7 @@ class Chat extends \Zotlabs\Web\Controller { } $profile = 0; - $channel = \App::get_channel(); + $channel = App::get_channel(); if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; @@ -49,16 +55,16 @@ class Chat extends \Zotlabs\Web\Controller { if((! $room) || (! local_channel())) return; - $channel = \App::get_channel(); + $channel = App::get_channel(); if($_POST['action'] === 'drop') { logger('delete chatroom'); - Zlib\Chatroom::destroy($channel,array('cr_name' => $room)); + Chatroom::destroy($channel,array('cr_name' => $room)); goaway(z_root() . '/chat/' . $channel['channel_address']); } - $acl = new \Zotlabs\Access\AccessList($channel); + $acl = new AccessList($channel); $acl->set_from_array($_REQUEST); $arr = $acl->get(); @@ -67,7 +73,7 @@ class Chat extends \Zotlabs\Web\Controller { if(intval($arr['expire']) < 0) $arr['expire'] = 0; - Zlib\Chatroom::create($channel,$arr); + Chatroom::create($channel,$arr); $x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1", dbesc($room), @@ -88,26 +94,35 @@ class Chat extends \Zotlabs\Web\Controller { function get() { + + if(! Apps::system_app_installed(App::$profile_uid, 'Chatrooms')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Chatrooms App (Not Installed):</b><br>'; + $o .= t('Access Controlled Chatrooms'); + return $o; + } if(local_channel()) { - $channel = \App::get_channel(); - nav_set_selected('My Chatrooms'); + $channel = App::get_channel(); + nav_set_selected('Chatrooms'); } - $ob = \App::get_observer(); + $ob = App::get_observer(); $observer = get_observer_hash(); if(! $observer) { notice( t('Permission denied.') . EOL); return; } - if(! perm_is_allowed(\App::$profile['profile_uid'],$observer,'chat')) { + if(! perm_is_allowed(App::$profile['profile_uid'],$observer,'chat')) { notice( t('Permission denied.') . EOL); return; } if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) { - Zlib\Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']); + Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']); goaway(z_root() . '/channel/' . argv(1)); } @@ -160,16 +175,16 @@ class Chat extends \Zotlabs\Web\Controller { $room_id = intval(argv(2)); $bookmark_link = get_bookmark_link($ob); - $x = Zlib\Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']); + $x = Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']); if(! $x) return; $x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1", intval($room_id), - intval(\App::$profile['profile_uid']) + intval(App::$profile['profile_uid']) ); if($x) { - $acl = new \Zotlabs\Access\AccessList(false); + $acl = new AccessList(false); $acl->set($x[0]); $private = $acl->is_private(); @@ -208,19 +223,12 @@ class Chat extends \Zotlabs\Web\Controller { )); return $o; } - - + require_once('include/conversation.php'); - //$o = profile_tabs($a,((local_channel() && local_channel() == \App::$profile['profile_uid']) ? true : false),\App::$profile['channel_address']); $o = ''; - - if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) { - notice( t('Feature disabled.') . EOL); - return $o; - } - $acl = new \Zotlabs\Access\AccessList($channel); + $acl = new AccessList($channel); $channel_acl = $acl->get(); $lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock'); @@ -244,17 +252,17 @@ class Chat extends \Zotlabs\Web\Controller { )); } - $rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']); + $rooms = Chatroom::roomlist(App::$profile['profile_uid']); $o .= replace_macros(get_markup_template('chatrooms.tpl'), array( - '$header' => sprintf( t('%1$s\'s Chatrooms'), \App::$profile['fullname']), + '$header' => sprintf( t('%1$s\'s Chatrooms'), App::$profile['fullname']), '$name' => t('Name'), '$baseurl' => z_root(), - '$nickname' => \App::$profile['channel_address'], + '$nickname' => App::$profile['channel_address'], '$rooms' => $rooms, '$norooms' => t('No chatrooms available'), '$newroom' => t('Create New'), - '$is_owner' => ((local_channel() && local_channel() == \App::$profile['profile_uid']) ? 1 : 0), + '$is_owner' => ((local_channel() && local_channel() == App::$profile['profile_uid']) ? 1 : 0), '$chatroom_new' => $chatroom_new, '$expire' => t('Expiration'), '$expire_unit' => t('min') //minutes diff --git a/Zotlabs/Module/Invite.php b/Zotlabs/Module/Invite.php index 359f99b3e..234802746 100644 --- a/Zotlabs/Module/Invite.php +++ b/Zotlabs/Module/Invite.php @@ -1,6 +1,10 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; + /** * module: invite.php * @@ -9,7 +13,7 @@ namespace Zotlabs\Module; */ -class Invite extends \Zotlabs\Web\Controller { +class Invite extends Controller { function post() { @@ -17,6 +21,10 @@ class Invite extends \Zotlabs\Web\Controller { notice( t('Permission denied.') . EOL); return; } + + if(! Apps::system_app_installed(local_channel(), 'Invite')) { + return; + } check_form_security_token_redirectOnErr('/', 'send_invite'); @@ -57,7 +65,7 @@ class Invite extends \Zotlabs\Web\Controller { else $nmessage = $message; - $account = \App::get_account(); + $account = App::get_account(); $res = z_mail( [ @@ -95,6 +103,15 @@ class Invite extends \Zotlabs\Web\Controller { return; } + if(! Apps::system_app_installed(local_channel(), 'Invite')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Invite App (Not Installed):</b><br>'; + $o .= t('Send email invitations to join this network'); + return $o; + } + nav_set_selected('Invite'); $tpl = get_markup_template('invite.tpl'); @@ -127,11 +144,11 @@ class Invite extends \Zotlabs\Web\Controller { } } - $ob = \App::get_observer(); + $ob = App::get_observer(); if(! $ob) return $o; - $channel = \App::get_channel(); + $channel = App::get_channel(); $o = replace_macros($tpl, array( '$form_security_token' => get_form_security_token("send_invite"), diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php index 0e5d85d05..9858beecd 100644 --- a/Zotlabs/Module/Lang.php +++ b/Zotlabs/Module/Lang.php @@ -1,13 +1,28 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; -class Lang extends \Zotlabs\Web\Controller { +class Lang extends Controller { function get() { + + if(local_channel()) { + if(! Apps::system_app_installed(local_channel(), 'Language')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Language App (Not Installed):</b><br>'; + $o .= t('Change UI language'); + return $o; + } + } + nav_set_selected('Language'); return lang_selector(); + } - } diff --git a/Zotlabs/Module/Mood.php b/Zotlabs/Module/Mood.php index ad29ec7e8..cceef5ffa 100644 --- a/Zotlabs/Module/Mood.php +++ b/Zotlabs/Module/Mood.php @@ -1,21 +1,29 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; + require_once('include/security.php'); require_once('include/bbcode.php'); require_once('include/items.php'); -class Mood extends \Zotlabs\Web\Controller { +class Mood extends Controller { function init() { if(! local_channel()) return; + + if(! Apps::system_app_installed(local_channel(), 'Mood')) { + return; + } $uid = local_channel(); - $channel = \App::get_channel(); + $channel = App::get_channel(); $verb = notags(trim($_GET['verb'])); if(! $verb) @@ -60,7 +68,7 @@ class Mood extends \Zotlabs\Web\Controller { $deny_gid = $channel['channel_deny_gid']; } - $poster = \App::get_observer(); + $poster = App::get_observer(); $mid = item_message_id(); @@ -117,6 +125,15 @@ class Mood extends \Zotlabs\Web\Controller { return; } + if(! Apps::system_app_installed(local_channel(), 'Mood')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Mood App (Not Installed):</b><br>'; + $o .= t('Set your current mood and tell your friends'); + return $o; + } + nav_set_selected('Mood'); $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0'); diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index ca0ec7844..ffe605538 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -167,8 +167,6 @@ class Network extends \Zotlabs\Web\Controller { } if(! $update) { - $tabs = ''; //network_tabs(); - $o .= $tabs; // search terms header if($search) { @@ -256,8 +254,7 @@ class Network extends \Zotlabs\Web\Controller { )); } - $o = $tabs; - $o .= $title; + $o = $title; $o .= $status_editor; } @@ -283,8 +280,7 @@ class Network extends \Zotlabs\Web\Controller { '$title' => '<a href="' . zid($cid_r[0]['xchan_url']) . '" ><img src="' . zid($cid_r[0]['xchan_photo_s']) . '" alt="' . urlencode($cid_r[0]['xchan_name']) . '" /></a> <a href="' . zid($cid_r[0]['xchan_url']) . '" >' . $cid_r[0]['xchan_name'] . '</a>' )); - $o = $tabs; - $o .= $title; + $o = $title; $o .= $status_editor; } elseif($xchan) { @@ -297,8 +293,8 @@ class Network extends \Zotlabs\Web\Controller { $title = replace_macros(get_markup_template("section_title.tpl"),array( '$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>' )); - $o = $tabs; - $o .= $title; + + $o = $title; $o .= $status_editor; } @@ -382,7 +378,8 @@ class Network extends \Zotlabs\Web\Controller { $sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG); } else { - $sql_extra .= sprintf(" AND item.body like '%s' ", + $sql_extra .= sprintf(" AND (item.body like '%s' OR item.title like '%s') ", + dbesc(protect_sprintf('%' . $search . '%')), dbesc(protect_sprintf('%' . $search . '%')) ); } diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 489bffc4a..f97f31ff7 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -620,10 +620,7 @@ class Photos extends \Zotlabs\Web\Controller { $o .= "<script> var profile_uid = " . \App::$profile['profile_uid'] . "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n"; - // tabs - $_is_owner = (local_channel() && (local_channel() == $owner_uid)); - //$o .= profile_tabs($a,$_is_owner, \App::$data['channel']['channel_address']); /** * Display upload form diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php index d13ec5ced..46dcf6dd3 100644 --- a/Zotlabs/Module/Poke.php +++ b/Zotlabs/Module/Poke.php @@ -1,6 +1,10 @@ <?php namespace Zotlabs\Module; /** @file */ +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; + /** * * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book @@ -18,15 +22,19 @@ namespace Zotlabs\Module; /** @file */ require_once('include/items.php'); -class Poke extends \Zotlabs\Web\Controller { +class Poke extends Controller { function init() { if(! local_channel()) return; + + if(! Apps::system_app_installed(local_channel(), 'Poke')) { + return; + } $uid = local_channel(); - $channel = \App::get_channel(); + $channel = App::get_channel(); $verb = notags(trim($_REQUEST['verb'])); @@ -150,6 +158,15 @@ class Poke extends \Zotlabs\Web\Controller { return; } + if(! Apps::system_app_installed(local_channel(), 'Poke')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Poke App (Not Installed):</b><br>'; + $o .= t('Poke somebody in your addressbook'); + return $o; + } + nav_set_selected('Poke'); $name = ''; diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index a3832d156..50b40834b 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -526,14 +526,21 @@ class Setup extends \Zotlabs\Web\Controller { $ck_funcs[0]['status'] = false; $ck_funcs[0]['help'] = t('Error: libCURL PHP module required but not installed.'); } - if(! function_exists('imagecreatefromjpeg')) { + if((! function_exists('imagecreatefromjpeg')) || (! class_exists('Imagick'))) { $ck_funcs[1]['status'] = false; - $ck_funcs[1]['help'] = t('Error: GD graphics PHP module with JPEG support required but not installed.'); + $ck_funcs[1]['help'] = t('Error: GD PHP module with JPEG support or ImageMagick graphics library required but not installed.'); } if(! function_exists('openssl_public_encrypt')) { $ck_funcs[2]['status'] = false; $ck_funcs[2]['help'] = t('Error: openssl PHP module required but not installed.'); } + if(class_exists('PDO')) { + $x = PDO::getAvailableDrivers(); + if((! in_array('mysql',$x)) && (! in_array('pgsql',$x))) { + $ck_funcs[3]['status'] = false; + $ck_funcs[3]['help'] = t('Error: PDO database PHP module missing a driver for either mysql or pgsql.'); + } + } if(! class_exists('PDO')) { $ck_funcs[3]['status'] = false; $ck_funcs[3]['help'] = t('Error: PDO database PHP module required but not installed.'); diff --git a/Zotlabs/Module/Sharedwithme.php b/Zotlabs/Module/Sharedwithme.php index 2c97e9726..c986f6695 100644 --- a/Zotlabs/Module/Sharedwithme.php +++ b/Zotlabs/Module/Sharedwithme.php @@ -97,7 +97,6 @@ class Sharedwithme extends \Zotlabs\Web\Controller { } - //$o = profile_tabs($a, $is_owner, $channel['channel_address']); $o = ''; $o .= replace_macros(get_markup_template('sharedwithme.tpl'), array( diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 97ec55ba3..c6599db3b 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -1,19 +1,25 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\Apps; +use Zotlabs\Lib\PermissionDescription; +use Zotlabs\Lib\ExtendedZip; +use ZipArchive; + require_once('include/channel.php'); require_once('include/conversation.php'); require_once('include/acl_selectors.php'); - -class Webpages extends \Zotlabs\Web\Controller { +class Webpages extends Controller { function init() { if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) { $sys = get_sys_channel(); if($sys && intval($sys['channel_id'])) { - \App::$is_sys = true; + App::$is_sys = true; } } @@ -29,23 +35,32 @@ class Webpages extends \Zotlabs\Web\Controller { function get() { - if(! \App::$profile) { + if(! App::$profile) { notice( t('Requested profile is not available.') . EOL ); - \App::$error = 404; + App::$error = 404; return; } + if(! Apps::system_app_installed(App::$profile_uid, 'Webpages')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Webpages App (Not Installed):</b><br>'; + $o .= t('Provide managed web pages on your channel'); + return $o; + } + nav_set_selected('Webpages'); $which = argv(1); - $_SESSION['return_url'] = \App::$query_string; + $_SESSION['return_url'] = App::$query_string; $uid = local_channel(); $owner = 0; - $observer = \App::get_observer(); + $observer = App::get_observer(); - $channel = \App::get_channel(); + $channel = App::get_channel(); switch ($_SESSION['action']) { case 'import': @@ -91,7 +106,7 @@ class Webpages extends \Zotlabs\Web\Controller { } - if(\App::$is_sys && is_site_admin()) { + if(App::$is_sys && is_site_admin()) { $sys = get_sys_channel(); if($sys && intval($sys['channel_id'])) { $uid = $owner = intval($sys['channel_id']); @@ -127,8 +142,8 @@ class Webpages extends \Zotlabs\Web\Controller { // Nickname is set to the observers xchan, and profile_uid to the owner's. // This lets you post pages at other people's channels. - if((! $channel) && ($uid) && ($uid == \App::$profile_uid)) { - $channel = \App::get_channel(); + if((! $channel) && ($uid) && ($uid == App::$profile_uid)) { + $channel = App::get_channel(); } if($channel) { $channel_acl = array( @@ -144,15 +159,15 @@ class Webpages extends \Zotlabs\Web\Controller { $is_owner = ($uid && $uid == $owner); - //$o = profile_tabs($a, $is_owner, \App::$profile['channel_address']); + $o = ''; $x = array( 'webpage' => ITEM_TYPE_WEBPAGE, 'is_owner' => true, - 'nickname' => \App::$profile['channel_address'], + 'nickname' => App::$profile['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), + 'acl' => (($is_owner) ? populate_acl($channel_acl,false, PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), 'visitor' => true, @@ -280,7 +295,7 @@ class Webpages extends \Zotlabs\Web\Controller { notice( t('Invalid file type.') . EOL); return; } - $zip = new \ZipArchive(); + $zip = new ZipArchive(); if ($zip->open($source) === true) { $tmp_folder_name = random_string(5); $website = dirname($source) . '/' . $tmp_folder_name; @@ -297,7 +312,7 @@ class Webpages extends \Zotlabs\Web\Controller { // Website files are to be imported from the channel cloud files if (($_POST) && array_key_exists('path',$_POST) && isset($_POST['cloudsubmit'])) { - $channel = \App::get_channel(); + $channel = App::get_channel(); $dirpath = get_dirpath_by_cloudpath($channel, $_POST['path']); if(!$dirpath) { notice( t('Invalid folder path.') . EOL); @@ -343,7 +358,7 @@ class Webpages extends \Zotlabs\Web\Controller { case 'importselected': require_once('include/import.php'); - $channel = \App::get_channel(); + $channel = App::get_channel(); // Import layout first so that pages that reference new layouts will find // the mid of layout items in the database @@ -438,7 +453,7 @@ class Webpages extends \Zotlabs\Web\Controller { case 'cloud': case 'zipfile': - $channel = \App::get_channel(); + $channel = App::get_channel(); $tmp_folder_name = random_string(10); $zip_folder_name = random_string(10); @@ -657,7 +672,7 @@ class Webpages extends \Zotlabs\Web\Controller { } if($action === 'zipfile') { // Generate the zip file - \Zotlabs\Lib\ExtendedZip::zipTree($tmp_folderpath, $zip_filepath, \ZipArchive::CREATE); + ExtendedZip::zipTree($tmp_folderpath, $zip_filepath, ZipArchive::CREATE); // Output the file for download header('Content-disposition: attachment; filename="' . $zip_filename . '"'); header("Content-Type: application/zip"); @@ -666,7 +681,7 @@ class Webpages extends \Zotlabs\Web\Controller { if(isset($_SESSION['exportcloudpath'])) { require_once('include/attach.php'); $cloudpath = urldecode($_SESSION['exportcloudpath']); - $channel = \App::get_channel(); + $channel = App::get_channel(); $dirpath = get_dirpath_by_cloudpath($channel, $cloudpath); if(!$dirpath) { $x = attach_mkdirp($channel, $channel['channel_hash'], array('pathname' => $cloudpath)); diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 25ecb6a6a..0fb5a4605 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -2,15 +2,20 @@ namespace Zotlabs\Module; -use \Zotlabs\Lib as Zlib; -use \Michelf\MarkdownExtra; +use App; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\Apps; +use Zotlabs\Lib\PermissionDescription; +use Zotlabs\Lib\NativeWiki; +use Zotlabs\Lib\NativeWikiPage; +use Zotlabs\Lib\MarkdownSoap; +use Michelf\MarkdownExtra; require_once('include/acl_selectors.php'); require_once('include/conversation.php'); require_once('include/bbcode.php'); - -class Wiki extends \Zotlabs\Web\Controller { +class Wiki extends Controller { private $wiki = null; @@ -40,10 +45,14 @@ class Wiki extends \Zotlabs\Web\Controller { return login(); } - if(! feature_enabled(\App::$profile_uid,'wiki')) { - notice( t('Not found') . EOL); - return; - } + if(! Apps::system_app_installed(App::$profile_uid, 'Wiki')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Wiki App (Not Installed):</b><br>'; + $o .= t('Provide a wiki for your channel'); + return $o; + } if(! perm_is_allowed(\App::$profile_uid,get_observer_hash(),'view_wiki')) { @@ -95,7 +104,7 @@ class Wiki extends \Zotlabs\Web\Controller { $owner['channel_deny_gid']) ? 'lock' : 'unlock' ), - 'acl' => populate_acl($owner_acl, false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_wiki')), + 'acl' => populate_acl($owner_acl, false, PermissionDescription::fromGlobalPermission('view_wiki')), 'allow_cid' => acl2json($owner_acl['allow_cid']), 'allow_gid' => acl2json($owner_acl['allow_gid']), 'deny_cid' => acl2json($owner_acl['deny_cid']), @@ -109,7 +118,7 @@ class Wiki extends \Zotlabs\Web\Controller { } $is_owner = ((local_channel()) && (local_channel() == \App::$profile['profile_uid']) ? true : false); - //$o = profile_tabs($a, $is_owner, \App::$profile['channel_address']); + $o = ''; // Download a wiki @@ -117,9 +126,9 @@ class Wiki extends \Zotlabs\Web\Controller { if((argc() > 3) && (argv(2) === 'download') && (argv(3) === 'wiki')) { $resource_id = argv(4); - $w = Zlib\NativeWiki::get_wiki($owner['channel_id'],$observer_hash,$resource_id); + $w = NativeWiki::get_wiki($owner['channel_id'],$observer_hash,$resource_id); -// $w = Zlib\NativeWiki::get_wiki($owner,$observer_hash,$resource_id); +// $w = NativeWiki::get_wiki($owner,$observer_hash,$resource_id); if(! $w['htmlName']) { notice(t('Error retrieving wiki') . EOL); } @@ -157,9 +166,9 @@ class Wiki extends \Zotlabs\Web\Controller { $content = html_entity_decode($iv['body'],ENT_COMPAT,'UTF-8'); } elseif($iv['mimetype'] === 'text/markdown') { - $content = html_entity_decode(Zlib\MarkdownSoap::unescape($iv['body']),ENT_COMPAT,'UTF-8'); + $content = html_entity_decode(MarkdownSoap::unescape($iv['body']),ENT_COMPAT,'UTF-8'); } - $fname = get_iconfig($iv['id'],'nwikipage','pagetitle') . Zlib\NativeWikiPage::get_file_ext($iv); + $fname = get_iconfig($iv['id'],'nwikipage','pagetitle') . NativeWikiPage::get_file_ext($iv); $zip->addFromString($fname,$content); $pages[] = $iv['mid']; } @@ -190,7 +199,7 @@ class Wiki extends \Zotlabs\Web\Controller { switch(argc()) { case 2: - $wikis = Zlib\NativeWiki::listwikis($owner, get_observer_hash()); + $wikis = NativeWiki::listwikis($owner, get_observer_hash()); if($wikis) { $o .= replace_macros(get_markup_template('wikilist.tpl'), array( @@ -256,7 +265,7 @@ class Wiki extends \Zotlabs\Web\Controller { $pageUrlName = urldecode($page_name); $langPageUrlName = urldecode(\App::$language . '/' . $page_name); - $w = Zlib\NativeWiki::exists_by_name($owner['channel_id'], $wikiUrlName); + $w = NativeWiki::exists_by_name($owner['channel_id'], $wikiUrlName); if(! $w['resource_id']) { notice(t('Wiki not found') . EOL); @@ -268,7 +277,7 @@ class Wiki extends \Zotlabs\Web\Controller { if(! $wiki_owner) { // Check for observer permissions $observer_hash = get_observer_hash(); - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['read']) { notice(t('Permission denied.') . EOL); goaway(z_root() . '/' . argv(0) . '/' . argv(1)); @@ -289,10 +298,10 @@ class Wiki extends \Zotlabs\Web\Controller { $p = []; if(! $ignore_language) { - $p = Zlib\NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $langPageUrlName)); + $p = NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $langPageUrlName)); } if(! ($p && $p['success'])) { - $p = Zlib\NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); + $p = NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); } if(! ($p && $p['success'])) { $x = new \Zotlabs\Widget\Wiki_pages(); @@ -306,7 +315,7 @@ class Wiki extends \Zotlabs\Web\Controller { //json_return_and_die(array('pages' => $page_list_html, 'message' => '', 'success' => true)); notice( t('Error retrieving page content') . EOL); //goaway(z_root() . '/' . argv(0) . '/' . argv(1) ); - $renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName); + $renderedContent = NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName); $showPageControls = $wiki_editor; } else { @@ -320,15 +329,15 @@ class Wiki extends \Zotlabs\Web\Controller { // Render the Markdown-formatted page content in HTML if($mimeType == 'text/bbcode') { - $renderedContent = Zlib\NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))), argv(0) . '/' . argv(1) . '/' . $wikiUrlName); + $renderedContent = NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))), argv(0) . '/' . argv(1) . '/' . $wikiUrlName); } elseif($mimeType === 'text/plain') { $renderedContent = str_replace(["\n",' ',"\t"],[EOL,' ',' '],htmlentities($content,ENT_COMPAT,'UTF-8',false)); } elseif($mimeType === 'text/markdown') { - $content = Zlib\MarkdownSoap::unescape($content); - $html = Zlib\NativeWikiPage::generate_toc(zidify_text(MarkdownExtra::defaultTransform(Zlib\NativeWikiPage::bbcode($content)))); - $renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName); + $content = MarkdownSoap::unescape($content); + $html = NativeWikiPage::generate_toc(zidify_text(MarkdownExtra::defaultTransform(NativeWikiPage::bbcode($content)))); + $renderedContent = NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName); } $showPageControls = $wiki_editor; } @@ -413,23 +422,23 @@ class Wiki extends \Zotlabs\Web\Controller { $content = $_POST['content']; $resource_id = $_POST['resource_id']; - $w = Zlib\NativeWiki::get_wiki($owner['channel_id'],$observer_hash,$resource_id); + $w = NativeWiki::get_wiki($owner['channel_id'],$observer_hash,$resource_id); $wikiURL = argv(0) . '/' . argv(1) . '/' . $w['urlName']; $mimeType = $_POST['mimetype']; if($mimeType === 'text/bbcode') { - $html = Zlib\NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))),$wikiURL); + $html = NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))),$wikiURL); } elseif($mimeType === 'text/markdown') { - $bb = Zlib\NativeWikiPage::bbcode($content); - $x = new ZLib\MarkdownSoap($bb); + $bb = NativeWikiPage::bbcode($content); + $x = new MarkdownSoap($bb); $md = $x->clean(); - $md = ZLib\MarkdownSoap::unescape($md); + $md = MarkdownSoap::unescape($md); $html = MarkdownExtra::defaultTransform($md); - $html = Zlib\NativeWikiPage::generate_toc(zidify_text($html)); - $html = Zlib\NativeWikiPage::convert_links($html,$wikiURL); + $html = NativeWikiPage::generate_toc(zidify_text($html)); + $html = NativeWikiPage::convert_links($html,$wikiURL); } elseif($mimeType === 'text/plain') { $html = str_replace(["\n",' ',"\t"],[EOL,' ',' '],htmlentities($content,ENT_COMPAT,'UTF-8',false)); @@ -466,7 +475,7 @@ class Wiki extends \Zotlabs\Web\Controller { return; //not reached } - $exists = Zlib\NativeWiki::exists_by_name($owner['channel_id'], $wiki['urlName']); + $exists = NativeWiki::exists_by_name($owner['channel_id'], $wiki['urlName']); if($exists['id']) { notice( t('A wiki with this name already exists.') . EOL); goaway('/wiki'); @@ -476,15 +485,15 @@ class Wiki extends \Zotlabs\Web\Controller { // Get ACL for permissions $acl = new \Zotlabs\Access\AccessList($owner); $acl->set_from_array($_POST); - $r = Zlib\NativeWiki::create_wiki($owner, $observer_hash, $wiki, $acl); + $r = NativeWiki::create_wiki($owner, $observer_hash, $wiki, $acl); if($r['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$r['item_id'],$r['item']['resource_id']); - $homePage = Zlib\NativeWikiPage::create_page($owner['channel_id'],$observer_hash,'Home', $r['item']['resource_id'], $wiki['mimeType']); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$r['item_id'],$r['item']['resource_id']); + $homePage = NativeWikiPage::create_page($owner['channel_id'],$observer_hash,'Home', $r['item']['resource_id'], $wiki['mimeType']); if(! $homePage['success']) { notice( t('Wiki created, but error creating Home page.')); goaway(z_root() . '/wiki/' . $nick . '/' . $wiki['urlName']); } - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$homePage['item_id'],$r['item']['resource_id']); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$homePage['item_id'],$r['item']['resource_id']); goaway(z_root() . '/wiki/' . $nick . '/' . $wiki['urlName'] . '/' . $homePage['page']['urlName']); } else { @@ -516,7 +525,7 @@ class Wiki extends \Zotlabs\Web\Controller { return; //not reached } - $wiki = Zlib\NativeWiki::exists_by_name($owner['channel_id'], urldecode($arr['urlName'])); + $wiki = NativeWiki::exists_by_name($owner['channel_id'], urldecode($arr['urlName'])); if($wiki['resource_id']) { @@ -525,9 +534,9 @@ class Wiki extends \Zotlabs\Web\Controller { $acl = new \Zotlabs\Access\AccessList($owner); $acl->set_from_array($_POST); - $r = Zlib\NativeWiki::update_wiki($owner['channel_id'], $observer_hash, $arr, $acl); + $r = NativeWiki::update_wiki($owner['channel_id'], $observer_hash, $arr, $acl); if($r['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$r['item_id'],$r['item']['resource_id']); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$r['item_id'],$r['item']['resource_id']); goaway(z_root() . '/wiki/' . $nick); } else { @@ -549,9 +558,9 @@ class Wiki extends \Zotlabs\Web\Controller { json_return_and_die(array('message' => t('Wiki delete permission denied.'), 'success' => false)); } $resource_id = $_POST['resource_id']; - $deleted = Zlib\NativeWiki::delete_wiki($owner['channel_id'],$observer_hash,$resource_id); + $deleted = NativeWiki::delete_wiki($owner['channel_id'],$observer_hash,$resource_id); if ($deleted['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$deleted['item_id'],$resource_id); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$deleted['item_id'],$resource_id); json_return_and_die(array('message' => '', 'success' => true)); } else { @@ -570,7 +579,7 @@ class Wiki extends \Zotlabs\Web\Controller { // Determine if observer has permission to create a page - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash, $mimetype); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash, $mimetype); if(! $perms['write']) { logger('Wiki write permission denied. ' . EOL); json_return_and_die(array('success' => false)); @@ -585,10 +594,10 @@ class Wiki extends \Zotlabs\Web\Controller { json_return_and_die(array('message' => 'Error creating page. Invalid name (' . print_r($_POST,true) . ').', 'success' => false)); } - $page = Zlib\NativeWikiPage::create_page($owner['channel_id'],$observer_hash, $name, $resource_id, $mimetype); + $page = NativeWikiPage::create_page($owner['channel_id'],$observer_hash, $name, $resource_id, $mimetype); if($page['item_id']) { - $commit = Zlib\NativeWikiPage::commit(array( + $commit = NativeWikiPage::commit(array( 'commit_msg' => t('New page created'), 'resource_id' => $resource_id, 'channel_id' => $owner['channel_id'], @@ -597,7 +606,7 @@ class Wiki extends \Zotlabs\Web\Controller { )); if($commit['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); json_return_and_die(array('url' => '/' . argv(0) . '/' . argv(1) . '/' . urlencode($page['wiki']['urlName']) . '/' . urlencode($page['page']['urlName']), 'success' => true)); } else { @@ -616,7 +625,7 @@ class Wiki extends \Zotlabs\Web\Controller { if((argc() === 5) && (argv(2) === 'get') && (argv(3) === 'page') && (argv(4) === 'list')) { $resource_id = $_POST['resource_id']; // resource_id for wiki in db - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(!$perms['read']) { logger('Wiki read permission denied.' . EOL); json_return_and_die(array('pages' => null, 'message' => 'Permission denied.', 'success' => false)); @@ -648,16 +657,16 @@ class Wiki extends \Zotlabs\Web\Controller { } // Determine if observer has permission to save content - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['write']) { logger('Wiki write permission denied. ' . EOL); json_return_and_die(array('success' => false)); } - $saved = Zlib\NativeWikiPage::save_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'content' => $content)); + $saved = NativeWikiPage::save_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'content' => $content)); if($saved['success']) { - $commit = Zlib\NativeWikiPage::commit(array( + $commit = NativeWikiPage::commit(array( 'commit_msg' => $commitMsg, 'pageUrlName' => $pageUrlName, 'resource_id' => $resource_id, @@ -667,7 +676,7 @@ class Wiki extends \Zotlabs\Web\Controller { )); if($commit['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true)); } else { @@ -688,7 +697,7 @@ class Wiki extends \Zotlabs\Web\Controller { // Determine if observer has permission to read content - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['read']) { logger('Wiki read permission denied.' . EOL); json_return_and_die(array('historyHTML' => '', 'message' => 'Permission denied.', 'success' => false)); @@ -720,15 +729,15 @@ class Wiki extends \Zotlabs\Web\Controller { json_return_and_die(array('success' => false)); } - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['write']) { logger('Wiki write permission denied. ' . EOL); json_return_and_die(array('success' => false)); } - $deleted = Zlib\NativeWikiPage::delete_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); + $deleted = NativeWikiPage::delete_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); if($deleted['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true)); } else { @@ -744,13 +753,13 @@ class Wiki extends \Zotlabs\Web\Controller { $commitHash = $_POST['commitHash']; // Determine if observer has permission to revert pages - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['write']) { logger('Wiki write permission denied.' . EOL); json_return_and_die(array('success' => false)); } - $reverted = Zlib\NativeWikiPage::revert_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'commitHash' => $commitHash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); + $reverted = NativeWikiPage::revert_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'commitHash' => $commitHash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); if($reverted['success']) { json_return_and_die(array('content' => $reverted['content'], 'message' => '', 'success' => true)); } else { @@ -766,13 +775,13 @@ class Wiki extends \Zotlabs\Web\Controller { $currentCommit = $_POST['currentCommit']; // Determine if observer has permission to revert pages - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(!$perms['read']) { logger('Wiki read permission denied.' . EOL); json_return_and_die(array('success' => false)); } - $compare = Zlib\NativeWikiPage::compare_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'currentCommit' => $currentCommit, 'compareCommit' => $compareCommit, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); + $compare = NativeWikiPage::compare_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'currentCommit' => $currentCommit, 'compareCommit' => $compareCommit, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); if($compare['success']) { $diffHTML = '<table class="text-center" width="100%"><tr><td class="lead" width="50%">' . t('Current Revision') . '</td><td class="lead" width="50%">' . t('Selected Revision') . '</td></tr></table>' . $compare['diff']; json_return_and_die(array('diff' => $diffHTML, 'message' => '', 'success' => true)); @@ -794,16 +803,16 @@ class Wiki extends \Zotlabs\Web\Controller { } // Determine if observer has permission to rename pages - $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); + $perms = NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash); if(! $perms['write']) { logger('Wiki write permission denied. ' . EOL); json_return_and_die(array('success' => false)); } - $renamed = Zlib\NativeWikiPage::rename_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'pageNewName' => $pageNewName)); + $renamed = NativeWikiPage::rename_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'pageNewName' => $pageNewName)); if($renamed['success']) { - $commit = Zlib\NativeWikiPage::commit(array( + $commit = NativeWikiPage::commit(array( 'channel_id' => $owner['channel_id'], 'commit_msg' => 'Renamed ' . urldecode($pageUrlName) . ' to ' . $renamed['page']['htmlName'], 'resource_id' => $resource_id, @@ -811,7 +820,7 @@ class Wiki extends \Zotlabs\Web\Controller { 'pageUrlName' => $pageNewName )); if($commit['success']) { - Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); + NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id); json_return_and_die(array('name' => $renamed['page'], 'message' => 'Wiki git repo commit made', 'success' => true)); } else { diff --git a/Zotlabs/Update/_1220.php b/Zotlabs/Update/_1220.php new file mode 100644 index 000000000..adcb8c9c6 --- /dev/null +++ b/Zotlabs/Update/_1220.php @@ -0,0 +1,47 @@ +<?php + +namespace Zotlabs\Update; + +class _1220 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("CREATE TABLE listeners ( + id serial NOT NULL, + target_id text NOT NULL, + portable_id text NOT NULL, + ltype smallint NOT NULL DEFAULT '0', + PRIMARY KEY (id) +)"); + + $r2 = q("create index \"target_id_idx\" on listeners (\"target_id\")"); + $r3 = q("create index \"portable_id_idx\" on listeners (\"portable_id\")"); + $r4 = q("create index \"ltype_idx\" on listeners (\"ltype\")"); + + $r = $r1 && $r2 && $r3 && $r4; + + } + + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + $r = q("CREATE TABLE IF NOT EXISTS listeners ( + id int(11) NOT NULL AUTO_INCREMENT, + target_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + portable_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + ltype int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY target_id (target_id), + KEY portable_id (portable_id), + KEY ltype (ltype) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + + } + + if($r) { + return UPDATE_SUCCESS; + } + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Web/SubModule.php b/Zotlabs/Web/SubModule.php index 7c8404201..763a55d86 100644 --- a/Zotlabs/Web/SubModule.php +++ b/Zotlabs/Web/SubModule.php @@ -2,6 +2,8 @@ namespace Zotlabs\Web; +use Zotlabs\Extend\Route; + /* * @brief * @@ -31,9 +33,23 @@ class SubModule { $filename = 'Zotlabs/Module/' . ucfirst(argv(0)) . '/'. ucfirst(argv($whicharg)) . '.php'; $modname = '\\Zotlabs\\Module\\' . ucfirst(argv(0)) . '\\' . ucfirst(argv($whicharg)); + if(file_exists($filename)) { $this->controller = new $modname(); } + + $routes = Route::get(); + + if($routes) { + foreach($routes as $route) { + if(is_array($route) && strtolower($route[1]) === strtolower(argv(0)) . '/' . strtolower(argv($whicharg))) { + include_once($route[0]); + if(class_exists($modname)) { + $this->controller = new $modname; + } + } + } + } } /** @@ -43,6 +59,7 @@ class SubModule { * @return boolean|mixed */ function call($method) { + if(! $this->controller) return false; diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index fadf39144..d725f8b55 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -180,7 +180,7 @@ class Activity_filter { $arr = ['tabs' => $tabs]; - call_hooks('network_tabs', $arr); + call_hooks('activity_filter', $arr); $o = ''; diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php index 27d1a971a..2dceee70e 100644 --- a/Zotlabs/Widget/Activity_order.php +++ b/Zotlabs/Widget/Activity_order.php @@ -110,7 +110,7 @@ class Activity_order { $arr = ['tabs' => $tabs]; - call_hooks('network_tabs', $arr); + call_hooks('activity_order', $arr); $o = ''; diff --git a/Zotlabs/Widget/Appstore.php b/Zotlabs/Widget/Appstore.php index 237707733..6a00ac06a 100644 --- a/Zotlabs/Widget/Appstore.php +++ b/Zotlabs/Widget/Appstore.php @@ -10,9 +10,9 @@ class Appstore { return replace_macros(get_markup_template('appstore.tpl'), [ '$title' => t('App Collections'), '$options' => [ - [ z_root() . '/apps/available', t('Available Apps'), $store ], - [ z_root() . '/apps', t('Installed apps'), 1 - $store ] + [ z_root() . '/apps', t('Installed apps'), 1 - $store ], + [ z_root() . '/apps/available', t('Available Apps'), $store ] ] ]); } -}
\ No newline at end of file +} diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 9bfa9742a..27d4b5980 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -2,6 +2,9 @@ namespace Zotlabs\Widget; +use App; +use Zotlabs\Lib\Apps; + require_once('include/contact_widgets.php'); class Categories { @@ -10,22 +13,22 @@ class Categories { $cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false); - if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards'))) + if(($cards) && (! Apps::system_app_installed(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'))) + 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 || $articles) ? 'view_pages' : 'view_stream')))) { + if((! App::$profile['profile_uid']) + || (! perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) { return ''; } $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : ''); - $srchurl = (($cards) ? \App::$argv[0] . '/' . \App::$argv[1] : \App::$query_string); + $srchurl = (($cards) ? App::$argv[0] . '/' . App::$argv[1] : App::$query_string); $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); diff --git a/app/articles.apd b/app/articles.apd index 5a9f17e0f..00b3c4a3c 100644 --- a/app/articles.apd +++ b/app/articles.apd @@ -1,6 +1,6 @@ -version: 1.2 +version: 1.3 url: $baseurl/articles/$nick name: Articles -requires: local_channel, articles +requires: local_channel photo: icon:file-text-o categories: nav_featured_app, Productivity diff --git a/app/cards.apd b/app/cards.apd index 8e2762ff8..ecc61b7f9 100644 --- a/app/cards.apd +++ b/app/cards.apd @@ -1,6 +1,6 @@ -version: 1.1 +version: 1.2 url: $baseurl/cards/$nick name: Cards -requires: local_channel, cards +requires: local_channel photo: icon:list categories: nav_featured_app, Productivity diff --git a/app/chat.apd b/app/chat.apd index b59d846a6..524c13bfd 100644 --- a/app/chat.apd +++ b/app/chat.apd @@ -1,6 +1,6 @@ -version: 1 +version: 1.1 url: $baseurl/chat/$nick -requires: local_channel, ajaxchat -name: My Chatrooms +requires: local_channel +name: Chatrooms photo: icon:comments-o categories: Productivity diff --git a/app/webpages.apd b/app/webpages.apd index 46c6cdb5d..e98cc0794 100644 --- a/app/webpages.apd +++ b/app/webpages.apd @@ -1,6 +1,6 @@ -version: 1 +version: 1.1 url: $baseurl/webpages/$nick -requires: local_channel, webpages +requires: local_channel name: Webpages photo: icon:newspaper-o categories: nav_featured_app, Productivity diff --git a/app/wiki.apd b/app/wiki.apd index 48fcbe0c1..56edfde20 100644 --- a/app/wiki.apd +++ b/app/wiki.apd @@ -1,6 +1,6 @@ -version: 1 +version: 1.1 url: $baseurl/wiki/$nick -requires: local_channel, wiki +requires: local_channel name: Wiki photo: icon:pencil-square-o categories: nav_featured_app, Productivity @@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.7.3' ); define ( 'ZOT_REVISION', '6.0a' ); -define ( 'DB_UPDATE_VERSION', 1219 ); +define ( 'DB_UPDATE_VERSION', 1220 ); define ( 'PROJECT_BASE', __DIR__ ); @@ -424,6 +424,7 @@ define ( 'TERM_BOOKMARK', 8 ); define ( 'TERM_HIERARCHY', 9 ); define ( 'TERM_COMMUNITYTAG', 10 ); define ( 'TERM_FORUM', 11 ); +define ( 'TERM_EMOJI', 12 ); define ( 'TERM_OBJ_POST', 1 ); define ( 'TERM_OBJ_PHOTO', 2 ); diff --git a/doc/hook/activity_filter.bb b/doc/hook/activity_filter.bb new file mode 100644 index 000000000..9d0768577 --- /dev/null +++ b/doc/hook/activity_filter.bb @@ -0,0 +1 @@ +[h2]activity_filter[/h2] diff --git a/doc/hook/activity_order.bb b/doc/hook/activity_order.bb new file mode 100644 index 000000000..4a4670d03 --- /dev/null +++ b/doc/hook/activity_order.bb @@ -0,0 +1 @@ +[h2]activity_order[/h2] diff --git a/doc/hook/network_tabs.bb b/doc/hook/network_tabs.bb deleted file mode 100644 index 677d7f2b9..000000000 --- a/doc/hook/network_tabs.bb +++ /dev/null @@ -1 +0,0 @@ -[h2]network_tabs[/h2] diff --git a/doc/hook/profile_tabs.bb b/doc/hook/profile_tabs.bb deleted file mode 100644 index 5b3e9e707..000000000 --- a/doc/hook/profile_tabs.bb +++ /dev/null @@ -1 +0,0 @@ -[h2]profile_tabs[/h2] diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 34e19660e..4b36fa3e0 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -31,6 +31,12 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/account_settings_post]account_settings_post[/zrl] Called when posting from the account settings form +[zrl=[baseurl]/help/hook/activity_filter]activity_filter[/zrl] + Called when generating the list of filters for the network page + +[zrl=[baseurl]/help/hook/activity_order]activity_order[/zrl] + Called when generating the list of order options for the network page + [zrl=[baseurl]/help/hook/activity_received]activity_received[/zrl] Called when an activity (post, comment, like, etc.) has been received from a zot source @@ -394,9 +400,6 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/network_ping]network_ping[/zrl] Called during a ping request -[zrl=[baseurl]/help/hook/network_tabs]network_tabs[/zrl] - Called when generating the list of tabs for the network page - [zrl=[baseurl]/help/hook/network_to_name]network_to_name[/zrl] Deprecated @@ -535,9 +538,6 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/profile_sidebar_enter]profile_sidebar_enter[/zrl] Called before generating the 'channel sidebar' or mini-profile -[zrl=[baseurl]/help/hook/profile_tabs]profile_tabs[/zrl] - Called when generating the tabs for channel related pages (channel,profile,files,etc.) - [zrl=[baseurl]/help/hook/queue_deliver]queue_deliver[/zrl] Called when delivering a queued message diff --git a/doc/hooks.html b/doc/hooks.html index 6009127f6..a7ee314e7 100644 --- a/doc/hooks.html +++ b/doc/hooks.html @@ -1 +1 @@ -<div><h3>Hooks</h3><table><tr><td>Function</td><td>Source File</td><td>Arg</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>$a->module . _mod_aftercontent</td><td>index.php</td><td>$arr</td></tr><tr><td>$a->module . _mod_content</td><td>index.php</td><td>$arr</td></tr><tr><td>$a->module . _mod_init</td><td>index.php</td><td>$placeholder</td></tr><tr><td>$a->module . _mod_post</td><td>index.php</td><td>$_POST</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$name</td><td>include/plugin.php</td><td>&$data = null</td></tr><tr><td>about_hook</td><td>mod/siteinfo.php</td><td>$o</td></tr><tr><td>accept_follow</td><td>mod/connedit.php</td><td>$arr</td></tr><tr><td>account_downgrade</td><td>include/account.php</td><td>$ret</td></tr><tr><td>account_downgrade</td><td>include/account.php</td><td>$ret</td></tr><tr><td>account_settings</td><td>mod/settings.php</td><td>$account_settings</td></tr><tr><td>activity_received</td><td>include/zot.php</td><td>$parr</td></tr><tr><td>affinity_labels</td><td>include/widgets.php</td><td>$labels</td></tr><tr><td>affinity_labels</td><td>mod/connedit.php</td><td>$labels</td></tr><tr><td>api_perm_is_allowed</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>app_menu</td><td>index.php</td><td>$arr</td></tr><tr><td>atom_author</td><td>include/items.php</td><td>$o</td></tr><tr><td>atom_entry</td><td>include/items.php</td><td>$o</td></tr><tr><td>atom_feed</td><td>include/items.php</td><td>$atom</td></tr><tr><td>atom_feed_end</td><td>include/items.php</td><td>$atom</td></tr><tr><td>attach_upload_file</td><td>include/attach.php</td><td>$f</td></tr><tr><td>authenticate</td><td>include/auth.php</td><td>$addon_auth</td></tr><tr><td>avatar_lookup</td><td>include/network.php</td><td>$avatar</td></tr><tr><td>bb2diaspora</td><td>include/markdown.php</td><td>$Text</td></tr><tr><td>bbcode</td><td>include/bbcode.php</td><td>$Text</td></tr><tr><td>channel_remove</td><td>include/Contact.php</td><td>$r[0]</td></tr><tr><td>chat_message</td><td>include/chat.php</td><td>$arr</td></tr><tr><td>chat_post</td><td>mod/chatsvc.php</td><td>$arr</td></tr><tr><td>check_account_email</td><td>include/account.php</td><td>$arr</td></tr><tr><td>check_account_invite</td><td>include/account.php</td><td>$arr</td></tr><tr><td>check_account_password</td><td>include/account.php</td><td>$arr</td></tr><tr><td>connect_premium</td><td>mod/connect.php</td><td>$arr</td></tr><tr><td>connector_settings</td><td>mod/settings.php</td><td>$settings_connectors</td></tr><tr><td>construct_page</td><td>boot.php</td><td>$arr</td></tr><tr><td>contact_block_end</td><td>include/text.php</td><td>$arr</td></tr><tr><td>contact_edit</td><td>mod/connedit.php</td><td>$arr</td></tr><tr><td>contact_edit_post</td><td>mod/connedit.php</td><td>$_POST</td></tr><tr><td>contact_select_options</td><td>include/acl_selectors.php</td><td>$x</td></tr><tr><td>conversation_start</td><td>include/conversation.php</td><td>$cb</td></tr><tr><td>create_identity</td><td>include/channel.php</td><td>$newuid</td></tr><tr><td>cron</td><td>include/cronhooks.php</td><td>$d</td></tr><tr><td>cron_daily</td><td>include/poller.php</td><td>datetime_convert()</td></tr><tr><td>cron_weekly</td><td>include/poller.php</td><td>datetime_convert()</td></tr><tr><td>directory_item</td><td>mod/directory.php</td><td>$arr</td></tr><tr><td>discover_by_webbie</td><td>include/network.php</td><td>$arr</td></tr><tr><td>display_item</td><td>include/ItemObject.php</td><td>$arr</td></tr><tr><td>display_item</td><td>include/conversation.php</td><td>$arr</td></tr><tr><td>display_settings</td><td>mod/settings.php</td><td>$o</td></tr><tr><td>display_settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>donate_contributors</td><td>extend/addon/matrix/donate/donate.php</td><td>$contributors</td></tr><tr><td>donate_plugin</td><td>extend/addon/matrix/donate/donate.php</td><td>$o</td></tr><tr><td>donate_sponsors</td><td>extend/addon/matrix/donate/donate.php</td><td>$sponsors</td></tr><tr><td>dreport_is_storable</td><td>include/zot.php</td><td>$dr</td></tr><tr><td>drop_item</td><td>include/items.php</td><td>$arr</td></tr><tr><td>enotify</td><td>include/enotify.php</td><td>$h</td></tr><tr><td>enotify_mail</td><td>include/enotify.php</td><td>$datarray</td></tr><tr><td>enotify_store</td><td>include/enotify.php</td><td>$datarray</td></tr><tr><td>event_created</td><td>include/event.php</td><td>$event[id]</td></tr><tr><td>event_updated</td><td>include/event.php</td><td>$event[id]</td></tr><tr><td>externals_url_select</td><td>include/externals.php</td><td>$arr</td></tr><tr><td>feature_enabled</td><td>include/features.php</td><td>$arr</td></tr><tr><td>feature_settings</td><td>mod/settings.php</td><td>$settings_addons</td></tr><tr><td>feature_settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>follow</td><td>include/follow.php</td><td>$arr</td></tr><tr><td>follow</td><td>include/follow.php</td><td>$arr</td></tr><tr><td>follow_allow</td><td>include/follow.php</td><td>$x</td></tr><tr><td>gender_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>gender_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>generate_map</td><td>include/text.php</td><td>$arr</td></tr><tr><td>generate_named_map</td><td>include/text.php</td><td>$arr</td></tr><tr><td>get_all_api_perms</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>get_all_perms</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>get_features</td><td>include/features.php</td><td>$arr</td></tr><tr><td>get_role_perms</td><td>include/permissions.php</td><td>$ret</td></tr><tr><td>get_widgets</td><td>boot.php</td><td>$arr</td></tr><tr><td>get_widgets</td><td>boot.php</td><td>$arr</td></tr><tr><td>global_permissions</td><td>include/permissions.php</td><td>$ret</td></tr><tr><td>home_content</td><td>mod/home.php</td><td>$o</td></tr><tr><td>home_init</td><td>mod/home.php</td><td>$ret</td></tr><tr><td>hostxrd</td><td>mod/hostxrd.php</td><td>$arr</td></tr><tr><td>html2bbcode</td><td>include/html2bbcode.php</td><td>$message</td></tr><tr><td>identity_basic_export</td><td>include/channel.php</td><td>$addon</td></tr><tr><td>import_author_xchan</td><td>include/items.php</td><td>$arr</td></tr><tr><td>import_channel</td><td>mod/import.php</td><td>$addon</td></tr><tr><td>import_directory_profile</td><td>include/zot.php</td><td>$d</td></tr><tr><td>import_xchan</td><td>include/zot.php</td><td>$arr</td></tr><tr><td>item_photo_menu</td><td>include/conversation.php</td><td>$args</td></tr><tr><td>item_store</td><td>include/items.php</td><td>$d</td></tr><tr><td>item_store</td><td>include/items.php</td><td>$arr</td></tr><tr><td>item_store_update</td><td>include/items.php</td><td>$d</td></tr><tr><td>item_translate</td><td>include/items.php</td><td>$translate</td></tr><tr><td>item_translate</td><td>include/items.php</td><td>$translate</td></tr><tr><td>jot_networks</td><td>include/acl_selectors.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>include/conversation.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editblock.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editpost.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editwebpage.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editlayout.php</td><td>$jotnets</td></tr><tr><td>jot_tool</td><td>include/conversation.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editblock.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editpost.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editwebpage.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editlayout.php</td><td>$jotplugins</td></tr><tr><td>load_pdl</td><td>boot.php</td><td>$arr</td></tr><tr><td>local_dir_update</td><td>include/dir_fns.php</td><td>$arr</td></tr><tr><td>logged_in</td><td>include/oauth.php</td><td>$a->user</td></tr><tr><td>logged_in</td><td>include/api.php</td><td>$a->user</td></tr><tr><td>logged_in</td><td>include/security.php</td><td>$a->account</td></tr><tr><td>logged_in</td><td>include/security.php</td><td>$user_record</td></tr><tr><td>logging_out</td><td>include/auth.php</td><td>$args</td></tr><tr><td>login_hook</td><td>boot.php</td><td>$o</td></tr><tr><td>magic_auth</td><td>mod/magic.php</td><td>$arr</td></tr><tr><td>magic_auth_openid_success</td><td>mod/openid.php</td><td>$arr</td></tr><tr><td>magic_auth_openid_success</td><td>mod/openid.php</td><td>$arr</td></tr><tr><td>magic_auth_success</td><td>mod/post.php</td><td>$arr</td></tr><tr><td>main_slider</td><td>include/widgets.php</td><td>$arr</td></tr><tr><td>marital_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>marital_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>module_loaded</td><td>index.php</td><td>$x</td></tr><tr><td>mood_verbs</td><td>include/text.php</td><td>$arr</td></tr><tr><td>nav</td><td>include/nav.php</td><td>$x</td></tr><tr><td>network_content_init</td><td>mod/network.php</td><td>$arr</td></tr><tr><td>network_ping</td><td>mod/ping.php</td><td>$arr</td></tr><tr><td>network_tabs</td><td>include/conversation.php</td><td>$arr</td></tr><tr><td>network_to_name</td><td>include/contact_selectors.php</td><td>$nets</td></tr><tr><td>notifier_end</td><td>include/notifier.php</td><td>$target_item</td></tr><tr><td>notifier_hub</td><td>include/notifier.php</td><td>$narr</td></tr><tr><td>notifier_normal</td><td>include/deliver_hooks.php</td><td>$r[0]</td></tr><tr><td>obj_verbs</td><td>include/taxonomy.php</td><td>$arr</td></tr><tr><td>oembed_probe</td><td>include/oembed.php</td><td>$x</td></tr><tr><td>page_content_top</td><td>index.php</td><td>$a->page[content]</td></tr><tr><td>page_end</td><td>index.php</td><td>$a->page[content]</td></tr><tr><td>page_header</td><td>include/nav.php</td><td>$a->page[nav]</td></tr><tr><td>parse_atom</td><td>include/items.php</td><td>$arr</td></tr><tr><td>parse_link</td><td>mod/linkinfo.php</td><td>$arr</td></tr><tr><td>pdl_selector</td><td>include/comanche.php</td><td>$arr</td></tr><tr><td>perm_is_allowed</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>permissions_create</td><td>include/notifier.php</td><td>$perm_update</td></tr><tr><td>permissions_update</td><td>include/notifier.php</td><td>$perm_update</td></tr><tr><td>personal_xrd</td><td>mod/xrd.php</td><td>$arr</td></tr><tr><td>photo_post_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_post_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_begin</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>photo_upload_begin</td><td>include/photos.php</td><td>$args</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_file</td><td>include/attach.php</td><td>$f</td></tr><tr><td>photo_upload_file</td><td>include/photos.php</td><td>$f</td></tr><tr><td>photo_upload_form</td><td>mod/photos.php</td><td>$ret</td></tr><tr><td>poke_verbs</td><td>include/text.php</td><td>$arr</td></tr><tr><td>post_local</td><td>include/zot.php</td><td>$arr</td></tr><tr><td>post_local</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_local</td><td>mod/item.php</td><td>$datarray</td></tr><tr><td>post_local_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>extend/addon/matrix/randpost/randpost.php</td><td>$x</td></tr><tr><td>post_local_end</td><td>extend/addon/matrix/randpost/randpost.php</td><td>$x</td></tr><tr><td>post_local_end</td><td>mod/mood.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>mod/like.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>mod/item.php</td><td>$datarray</td></tr><tr><td>post_local_end</td><td>mod/subthread.php</td><td>$arr</td></tr><tr><td>post_local_start</td><td>mod/item.php</td><td>$_REQUEST</td></tr><tr><td>post_mail</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_mail_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_update</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_update_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>prepare_body</td><td>include/text.php</td><td>$prep_arr</td></tr><tr><td>prepare_body_final</td><td>include/text.php</td><td>$prep_arr</td></tr><tr><td>prepare_body_init</td><td>include/text.php</td><td>$item</td></tr><tr><td>probe_well_known</td><td>include/probe.php</td><td>$ret</td></tr><tr><td>proc_run</td><td>boot.php</td><td>$arr</td></tr><tr><td>process_channel_sync_delivery</td><td>include/zot.php</td><td>$addon</td></tr><tr><td>profile_advanced</td><td>mod/profile.php</td><td>$o</td></tr><tr><td>profile_edit</td><td>mod/profiles.php</td><td>$arr</td></tr><tr><td>profile_photo_content_end</td><td>mod/profile_photo.php</td><td>$o</td></tr><tr><td>profile_post</td><td>mod/profiles.php</td><td>$_POST</td></tr><tr><td>profile_sidebar</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>profile_sidebar_enter</td><td>include/channel.php</td><td>$profile</td></tr><tr><td>profile_tabs</td><td>include/conversation.php</td><td>$arr</td></tr><tr><td>register_account</td><td>include/account.php</td><td>$result</td></tr><tr><td>render_location</td><td>include/conversation.php</td><td>$locate</td></tr><tr><td>replace_macros</td><td>include/text.php</td><td>$arr</td></tr><tr><td>reverse_magic_auth</td><td>mod/rmagic.php</td><td>$arr</td></tr><tr><td>settings_account</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>settings_form</td><td>mod/settings.php</td><td>$o</td></tr><tr><td>settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>sexpref_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>sexpref_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>smilie</td><td>include/text.php</td><td>$params</td></tr><tr><td>smilie</td><td>extend/addon/matrix/smileybutton/smileybutton.php</td><td>$params</td></tr><tr><td>tagged</td><td>include/items.php</td><td>$arr</td></tr><tr><td>validate_channelname</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>webfinger</td><td>mod/wfinger.php</td><td>$arr</td></tr><tr><td>well_known</td><td>mod/_well_known.php</td><td>$arr</td></tr><tr><td>zid</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>zid_init</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>zot_finger</td><td>include/zot.php</td><td>$ret</td></tr></table><p>Generated Tue Nov 03 21:19:02 PST 2015</p></div>
\ No newline at end of file +<div><h3>Hooks</h3><table><tr><td>Function</td><td>Source File</td><td>Arg</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>$a->module . _mod_aftercontent</td><td>index.php</td><td>$arr</td></tr><tr><td>$a->module . _mod_content</td><td>index.php</td><td>$arr</td></tr><tr><td>$a->module . _mod_init</td><td>index.php</td><td>$placeholder</td></tr><tr><td>$a->module . _mod_post</td><td>index.php</td><td>$_POST</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _post_ . $selname</td><td>include/acl_selectors.php</td><td>$o</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$a->module . _pre_ . $selname</td><td>include/acl_selectors.php</td><td>$arr</td></tr><tr><td>$name</td><td>include/plugin.php</td><td>&$data = null</td></tr><tr><td>about_hook</td><td>mod/siteinfo.php</td><td>$o</td></tr><tr><td>accept_follow</td><td>mod/connedit.php</td><td>$arr</td></tr><tr><td>account_downgrade</td><td>include/account.php</td><td>$ret</td></tr><tr><td>account_downgrade</td><td>include/account.php</td><td>$ret</td></tr><tr><td>account_settings</td><td>mod/settings.php</td><td>$account_settings</td></tr><tr><td>activity_received</td><td>include/zot.php</td><td>$parr</td></tr><tr><td>affinity_labels</td><td>include/widgets.php</td><td>$labels</td></tr><tr><td>affinity_labels</td><td>mod/connedit.php</td><td>$labels</td></tr><tr><td>api_perm_is_allowed</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>app_menu</td><td>index.php</td><td>$arr</td></tr><tr><td>atom_author</td><td>include/items.php</td><td>$o</td></tr><tr><td>atom_entry</td><td>include/items.php</td><td>$o</td></tr><tr><td>atom_feed</td><td>include/items.php</td><td>$atom</td></tr><tr><td>atom_feed_end</td><td>include/items.php</td><td>$atom</td></tr><tr><td>attach_upload_file</td><td>include/attach.php</td><td>$f</td></tr><tr><td>authenticate</td><td>include/auth.php</td><td>$addon_auth</td></tr><tr><td>avatar_lookup</td><td>include/network.php</td><td>$avatar</td></tr><tr><td>bb2diaspora</td><td>include/markdown.php</td><td>$Text</td></tr><tr><td>bbcode</td><td>include/bbcode.php</td><td>$Text</td></tr><tr><td>channel_remove</td><td>include/Contact.php</td><td>$r[0]</td></tr><tr><td>chat_message</td><td>include/chat.php</td><td>$arr</td></tr><tr><td>chat_post</td><td>mod/chatsvc.php</td><td>$arr</td></tr><tr><td>check_account_email</td><td>include/account.php</td><td>$arr</td></tr><tr><td>check_account_invite</td><td>include/account.php</td><td>$arr</td></tr><tr><td>check_account_password</td><td>include/account.php</td><td>$arr</td></tr><tr><td>connect_premium</td><td>mod/connect.php</td><td>$arr</td></tr><tr><td>connector_settings</td><td>mod/settings.php</td><td>$settings_connectors</td></tr><tr><td>construct_page</td><td>boot.php</td><td>$arr</td></tr><tr><td>contact_block_end</td><td>include/text.php</td><td>$arr</td></tr><tr><td>contact_edit</td><td>mod/connedit.php</td><td>$arr</td></tr><tr><td>contact_edit_post</td><td>mod/connedit.php</td><td>$_POST</td></tr><tr><td>contact_select_options</td><td>include/acl_selectors.php</td><td>$x</td></tr><tr><td>conversation_start</td><td>include/conversation.php</td><td>$cb</td></tr><tr><td>create_identity</td><td>include/channel.php</td><td>$newuid</td></tr><tr><td>cron</td><td>include/cronhooks.php</td><td>$d</td></tr><tr><td>cron_daily</td><td>include/poller.php</td><td>datetime_convert()</td></tr><tr><td>cron_weekly</td><td>include/poller.php</td><td>datetime_convert()</td></tr><tr><td>directory_item</td><td>mod/directory.php</td><td>$arr</td></tr><tr><td>discover_by_webbie</td><td>include/network.php</td><td>$arr</td></tr><tr><td>display_item</td><td>include/ItemObject.php</td><td>$arr</td></tr><tr><td>display_item</td><td>include/conversation.php</td><td>$arr</td></tr><tr><td>display_settings</td><td>mod/settings.php</td><td>$o</td></tr><tr><td>display_settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>donate_contributors</td><td>extend/addon/matrix/donate/donate.php</td><td>$contributors</td></tr><tr><td>donate_plugin</td><td>extend/addon/matrix/donate/donate.php</td><td>$o</td></tr><tr><td>donate_sponsors</td><td>extend/addon/matrix/donate/donate.php</td><td>$sponsors</td></tr><tr><td>dreport_is_storable</td><td>include/zot.php</td><td>$dr</td></tr><tr><td>drop_item</td><td>include/items.php</td><td>$arr</td></tr><tr><td>enotify</td><td>include/enotify.php</td><td>$h</td></tr><tr><td>enotify_mail</td><td>include/enotify.php</td><td>$datarray</td></tr><tr><td>enotify_store</td><td>include/enotify.php</td><td>$datarray</td></tr><tr><td>event_created</td><td>include/event.php</td><td>$event[id]</td></tr><tr><td>event_updated</td><td>include/event.php</td><td>$event[id]</td></tr><tr><td>externals_url_select</td><td>include/externals.php</td><td>$arr</td></tr><tr><td>feature_enabled</td><td>include/features.php</td><td>$arr</td></tr><tr><td>feature_settings</td><td>mod/settings.php</td><td>$settings_addons</td></tr><tr><td>feature_settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>follow</td><td>include/follow.php</td><td>$arr</td></tr><tr><td>follow</td><td>include/follow.php</td><td>$arr</td></tr><tr><td>follow_allow</td><td>include/follow.php</td><td>$x</td></tr><tr><td>gender_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>gender_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>generate_map</td><td>include/text.php</td><td>$arr</td></tr><tr><td>generate_named_map</td><td>include/text.php</td><td>$arr</td></tr><tr><td>get_all_api_perms</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>get_all_perms</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>get_features</td><td>include/features.php</td><td>$arr</td></tr><tr><td>get_role_perms</td><td>include/permissions.php</td><td>$ret</td></tr><tr><td>get_widgets</td><td>boot.php</td><td>$arr</td></tr><tr><td>get_widgets</td><td>boot.php</td><td>$arr</td></tr><tr><td>global_permissions</td><td>include/permissions.php</td><td>$ret</td></tr><tr><td>home_content</td><td>mod/home.php</td><td>$o</td></tr><tr><td>home_init</td><td>mod/home.php</td><td>$ret</td></tr><tr><td>hostxrd</td><td>mod/hostxrd.php</td><td>$arr</td></tr><tr><td>html2bbcode</td><td>include/html2bbcode.php</td><td>$message</td></tr><tr><td>identity_basic_export</td><td>include/channel.php</td><td>$addon</td></tr><tr><td>import_author_xchan</td><td>include/items.php</td><td>$arr</td></tr><tr><td>import_channel</td><td>mod/import.php</td><td>$addon</td></tr><tr><td>import_directory_profile</td><td>include/zot.php</td><td>$d</td></tr><tr><td>import_xchan</td><td>include/zot.php</td><td>$arr</td></tr><tr><td>item_photo_menu</td><td>include/conversation.php</td><td>$args</td></tr><tr><td>item_store</td><td>include/items.php</td><td>$d</td></tr><tr><td>item_store</td><td>include/items.php</td><td>$arr</td></tr><tr><td>item_store_update</td><td>include/items.php</td><td>$d</td></tr><tr><td>item_translate</td><td>include/items.php</td><td>$translate</td></tr><tr><td>item_translate</td><td>include/items.php</td><td>$translate</td></tr><tr><td>jot_networks</td><td>include/acl_selectors.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>include/conversation.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editblock.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editpost.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editwebpage.php</td><td>$jotnets</td></tr><tr><td>jot_networks</td><td>mod/editlayout.php</td><td>$jotnets</td></tr><tr><td>jot_tool</td><td>include/conversation.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editblock.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editpost.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editwebpage.php</td><td>$jotplugins</td></tr><tr><td>jot_tool</td><td>mod/editlayout.php</td><td>$jotplugins</td></tr><tr><td>load_pdl</td><td>boot.php</td><td>$arr</td></tr><tr><td>local_dir_update</td><td>include/dir_fns.php</td><td>$arr</td></tr><tr><td>logged_in</td><td>include/oauth.php</td><td>$a->user</td></tr><tr><td>logged_in</td><td>include/api.php</td><td>$a->user</td></tr><tr><td>logged_in</td><td>include/security.php</td><td>$a->account</td></tr><tr><td>logged_in</td><td>include/security.php</td><td>$user_record</td></tr><tr><td>logging_out</td><td>include/auth.php</td><td>$args</td></tr><tr><td>login_hook</td><td>boot.php</td><td>$o</td></tr><tr><td>magic_auth</td><td>mod/magic.php</td><td>$arr</td></tr><tr><td>magic_auth_openid_success</td><td>mod/openid.php</td><td>$arr</td></tr><tr><td>magic_auth_openid_success</td><td>mod/openid.php</td><td>$arr</td></tr><tr><td>magic_auth_success</td><td>mod/post.php</td><td>$arr</td></tr><tr><td>main_slider</td><td>include/widgets.php</td><td>$arr</td></tr><tr><td>marital_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>marital_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>module_loaded</td><td>index.php</td><td>$x</td></tr><tr><td>mood_verbs</td><td>include/text.php</td><td>$arr</td></tr><tr><td>nav</td><td>include/nav.php</td><td>$x</td></tr><tr><td>network_content_init</td><td>mod/network.php</td><td>$arr</td></tr><tr><td>network_ping</td><td>mod/ping.php</td><td>$arr</td></tr><tr><td>network_tabs</td><td>include/conversation.php</td><td>$arr</td></tr><tr><td>network_to_name</td><td>include/contact_selectors.php</td><td>$nets</td></tr><tr><td>notifier_end</td><td>include/notifier.php</td><td>$target_item</td></tr><tr><td>notifier_hub</td><td>include/notifier.php</td><td>$narr</td></tr><tr><td>notifier_normal</td><td>include/deliver_hooks.php</td><td>$r[0]</td></tr><tr><td>obj_verbs</td><td>include/taxonomy.php</td><td>$arr</td></tr><tr><td>oembed_probe</td><td>include/oembed.php</td><td>$x</td></tr><tr><td>page_content_top</td><td>index.php</td><td>$a->page[content]</td></tr><tr><td>page_end</td><td>index.php</td><td>$a->page[content]</td></tr><tr><td>page_header</td><td>include/nav.php</td><td>$a->page[nav]</td></tr><tr><td>parse_atom</td><td>include/items.php</td><td>$arr</td></tr><tr><td>parse_link</td><td>mod/linkinfo.php</td><td>$arr</td></tr><tr><td>pdl_selector</td><td>include/comanche.php</td><td>$arr</td></tr><tr><td>perm_is_allowed</td><td>include/permissions.php</td><td>$arr</td></tr><tr><td>permissions_create</td><td>include/notifier.php</td><td>$perm_update</td></tr><tr><td>permissions_update</td><td>include/notifier.php</td><td>$perm_update</td></tr><tr><td>personal_xrd</td><td>mod/xrd.php</td><td>$arr</td></tr><tr><td>photo_post_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_post_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_begin</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>photo_upload_begin</td><td>include/photos.php</td><td>$args</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/attach.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_end</td><td>include/photos.php</td><td>$ret</td></tr><tr><td>photo_upload_file</td><td>include/attach.php</td><td>$f</td></tr><tr><td>photo_upload_file</td><td>include/photos.php</td><td>$f</td></tr><tr><td>photo_upload_form</td><td>mod/photos.php</td><td>$ret</td></tr><tr><td>poke_verbs</td><td>include/text.php</td><td>$arr</td></tr><tr><td>post_local</td><td>include/zot.php</td><td>$arr</td></tr><tr><td>post_local</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_local</td><td>mod/item.php</td><td>$datarray</td></tr><tr><td>post_local_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>include/attach.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>extend/addon/matrix/randpost/randpost.php</td><td>$x</td></tr><tr><td>post_local_end</td><td>extend/addon/matrix/randpost/randpost.php</td><td>$x</td></tr><tr><td>post_local_end</td><td>mod/mood.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>mod/like.php</td><td>$arr</td></tr><tr><td>post_local_end</td><td>mod/item.php</td><td>$datarray</td></tr><tr><td>post_local_end</td><td>mod/subthread.php</td><td>$arr</td></tr><tr><td>post_local_start</td><td>mod/item.php</td><td>$_REQUEST</td></tr><tr><td>post_mail</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_mail_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_update</td><td>include/items.php</td><td>$arr</td></tr><tr><td>post_remote_update_end</td><td>include/items.php</td><td>$arr</td></tr><tr><td>prepare_body</td><td>include/text.php</td><td>$prep_arr</td></tr><tr><td>prepare_body_final</td><td>include/text.php</td><td>$prep_arr</td></tr><tr><td>prepare_body_init</td><td>include/text.php</td><td>$item</td></tr><tr><td>probe_well_known</td><td>include/probe.php</td><td>$ret</td></tr><tr><td>proc_run</td><td>boot.php</td><td>$arr</td></tr><tr><td>process_channel_sync_delivery</td><td>include/zot.php</td><td>$addon</td></tr><tr><td>profile_advanced</td><td>mod/profile.php</td><td>$o</td></tr><tr><td>profile_edit</td><td>mod/profiles.php</td><td>$arr</td></tr><tr><td>profile_photo_content_end</td><td>mod/profile_photo.php</td><td>$o</td></tr><tr><td>profile_post</td><td>mod/profiles.php</td><td>$_POST</td></tr><tr><td>profile_sidebar</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>profile_sidebar_enter</td><td>include/channel.php</td><td>$profile</td></tr><tr><td>register_account</td><td>include/account.php</td><td>$result</td></tr><tr><td>render_location</td><td>include/conversation.php</td><td>$locate</td></tr><tr><td>replace_macros</td><td>include/text.php</td><td>$arr</td></tr><tr><td>reverse_magic_auth</td><td>mod/rmagic.php</td><td>$arr</td></tr><tr><td>settings_account</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>settings_form</td><td>mod/settings.php</td><td>$o</td></tr><tr><td>settings_post</td><td>mod/settings.php</td><td>$_POST</td></tr><tr><td>sexpref_selector</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>sexpref_selector_min</td><td>include/profile_selectors.php</td><td>$select</td></tr><tr><td>smilie</td><td>include/text.php</td><td>$params</td></tr><tr><td>smilie</td><td>extend/addon/matrix/smileybutton/smileybutton.php</td><td>$params</td></tr><tr><td>tagged</td><td>include/items.php</td><td>$arr</td></tr><tr><td>validate_channelname</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>webfinger</td><td>mod/wfinger.php</td><td>$arr</td></tr><tr><td>well_known</td><td>mod/_well_known.php</td><td>$arr</td></tr><tr><td>zid</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>zid_init</td><td>include/channel.php</td><td>$arr</td></tr><tr><td>zot_finger</td><td>include/zot.php</td><td>$ret</td></tr></table><p>Generated Tue Nov 03 21:19:02 PST 2015</p></div>
\ No newline at end of file diff --git a/include/attach.php b/include/attach.php index 202412263..4db5bc435 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1428,6 +1428,8 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { if(! $r) { attach_drop_photo($channel_id,$resource); + $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo]; + call_hooks("attach_delete",$arr); return; } @@ -1486,6 +1488,9 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { intval($channel_id) ); + $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo]; + call_hooks("attach_delete",$arr); + file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true); return; diff --git a/include/conversation.php b/include/conversation.php index 4997bc2b7..28a339479 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1644,319 +1644,6 @@ function prepare_page($item) { )); } - -function network_tabs() { - - $no_active=''; - $starred_active = ''; - $new_active = ''; - $all_active = ''; - $search_active = ''; - $conv_active = ''; - $spam_active = ''; - $postord_active = ''; - - if(x($_GET,'new')) { - $new_active = 'active'; - } - - if(x($_GET,'search')) { - $search_active = 'active'; - } - - if(x($_GET,'star')) { - $starred_active = 'active'; - } - - if(x($_GET,'conv')) { - $conv_active = 'active'; - } - - if(x($_GET,'spam')) { - $spam_active = 'active'; - } - - if (($new_active == '') - && ($starred_active == '') - && ($conv_active == '') - && ($search_active == '') - && ($spam_active == '')) { - $no_active = 'active'; - } - - if ($no_active=='active' && x($_GET,'order')) { - switch($_GET['order']){ - case 'post': $postord_active = 'active'; $no_active=''; break; - case 'comment' : $all_active = 'active'; $no_active=''; break; - } - } - - if ($no_active=='active') $all_active='active'; - - $cmd = App::$cmd; - - // tabs - $tabs = array(); - - $tabs[] = array( - 'label' => t('Commented Order'), - 'url'=>z_root() . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), - 'sel'=>$all_active, - 'title'=> t('Sort by Comment Date'), - ); - - $tabs[] = array( - 'label' => t('Posted Order'), - 'url'=>z_root() . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), - 'sel'=>$postord_active, - 'title' => t('Sort by Post Date'), - ); - - if(feature_enabled(local_channel(),'personal_tab')) { - $tabs[] = array( - 'label' => t('Personal'), - 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1', - 'sel' => $conv_active, - 'title' => t('Posts that mention or involve you'), - ); - } - - if(feature_enabled(local_channel(),'new_tab')) { - $tabs[] = array( - 'label' => t('New'), - 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), - 'sel' => $new_active, - 'title' => t('Activity Stream - by date'), - ); - } - - if(feature_enabled(local_channel(),'star_posts')) { - $tabs[] = array( - 'label' => t('Starred'), - 'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&star=1', - 'sel'=>$starred_active, - 'title' => t('Favourite Posts'), - ); - } - // Not yet implemented - - if(feature_enabled(local_channel(),'spam_filter')) { - $tabs[] = array( - 'label' => t('Spam'), - 'url'=> z_root() . '/network?f=&spam=1', - 'sel'=> $spam_active, - 'title' => t('Posts flagged as SPAM'), - ); - } - - $arr = array('tabs' => $tabs); - call_hooks('network_tabs', $arr); - - $tpl = get_markup_template('common_tabs.tpl'); - - return replace_macros($tpl, array('$tabs' => $arr['tabs'])); -} - -/** - * @brief - * - * @param App $a - * @param boolean $is_owner default false - * @param string $nickname default null - * @return void|string - */ -function profile_tabs($a, $is_owner = false, $nickname = null){ - - // Don't provide any profile tabs if we're running as the sys channel - - if (App::$is_sys) - return; - - if (get_pconfig($uid, 'system', 'noprofiletabs')) - return; - - $channel = App::get_channel(); - - if (is_null($nickname)) - $nickname = $channel['channel_address']; - - - $uid = ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : local_channel()); - $account_id = ((App::$profile['profile_uid']) ? App::$profile['channel_account_id'] : App::$channel['channel_account_id']); - - if ($uid == local_channel()) - return; - - if($uid == local_channel()) { - $cal_link = ''; - } - else { - $cal_link = '/cal/' . $nickname; - } - - require_once('include/security.php'); - $sql_options = item_permissions_sql($uid); - - $r = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' - and item.item_delayed = 0 and item.item_deleted = 0 - and ( iconfig.k = 'WEBPAGE' and item_type = %d ) - $sql_options limit 1", - intval($uid), - dbesc('home'), - intval(ITEM_TYPE_WEBPAGE) - ); - - $has_webpages = (($r) ? true : false); - - if (x($_GET, 'tab')) - $tab = notags(trim($_GET['tab'])); - - $url = z_root() . '/channel/' . $nickname; - $pr = z_root() . '/profile/' . $nickname; - - $tabs = array( - array( - 'label' => t('Channel'), - 'url' => $url, - 'sel' => ((argv(0) == 'channel') ? 'active' : ''), - 'title' => t('Status Messages and Posts'), - 'id' => 'status-tab', - 'icon' => 'home' - ), - ); - - $p = get_all_perms($uid,get_observer_hash()); - - if ($p['view_profile']) { - $tabs[] = array( - 'label' => t('About'), - 'url' => $pr, - 'sel' => ((argv(0) == 'profile') ? 'active' : ''), - 'title' => t('Profile Details'), - 'id' => 'profile-tab', - 'icon' => 'user' - ); - } - if ($p['view_storage']) { - $tabs[] = array( - 'label' => t('Photos'), - 'url' => z_root() . '/photos/' . $nickname, - 'sel' => ((argv(0) == 'photos') ? 'active' : ''), - 'title' => t('Photo Albums'), - 'id' => 'photo-tab', - 'icon' => 'photo' - ); - $tabs[] = array( - 'label' => t('Files'), - 'url' => z_root() . '/cloud/' . $nickname, - 'sel' => ((argv(0) == 'cloud' || argv(0) == 'sharedwithme') ? 'active' : ''), - 'title' => t('Files and Storage'), - 'id' => 'files-tab', - 'icon' => 'folder-open' - ); - } - - if($p['view_stream'] && $cal_link) { - $tabs[] = array( - 'label' => t('Events'), - 'url' => z_root() . $cal_link, - 'sel' => ((argv(0) == 'cal' || argv(0) == 'events') ? 'active' : ''), - 'title' => t('Events'), - 'id' => 'event-tab', - 'icon' => 'calendar' - ); - } - - - if ($p['chat'] && feature_enabled($uid,'ajaxchat')) { - $has_chats = Zotlabs\Lib\Chatroom::list_count($uid); - if ($has_chats) { - $tabs[] = array( - 'label' => t('Chatrooms'), - 'url' => z_root() . '/chat/' . $nickname, - 'sel' => ((argv(0) == 'chat') ? 'active' : '' ), - 'title' => t('Chatrooms'), - 'id' => 'chat-tab', - 'icon' => 'comments-o' - ); - } - } - - require_once('include/menu.php'); - $has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK); - - if($is_owner && $has_bookmarks) { - $tabs[] = array( - 'label' => t('Bookmarks'), - 'url' => z_root() . '/bookmarks', - 'sel' => ((argv(0) == 'bookmarks') ? 'active' : ''), - 'title' => t('Saved Bookmarks'), - 'id' => 'bookmarks-tab', - 'icon' => 'bookmark' - ); - } - - if(feature_enabled($uid,'cards')) { - $tabs[] = array( - 'label' => t('Cards'), - 'url' => z_root() . '/cards/' . $nickname, - 'sel' => ((argv(0) == 'cards') ? 'active' : ''), - 'title' => t('View Cards'), - 'id' => 'cards-tab', - 'icon' => 'list' - ); - } - - if(feature_enabled($uid,'articles')) { - $tabs[] = array( - 'label' => t('articles'), - 'url' => z_root() . '/articles/' . $nickname, - 'sel' => ((argv(0) == 'articles') ? 'active' : ''), - 'title' => t('View Articles'), - 'id' => 'articles-tab', - 'icon' => 'file-text-o' - ); - } - - if($has_webpages && feature_enabled($uid,'webpages')) { - $tabs[] = array( - 'label' => t('Webpages'), - 'url' => z_root() . '/page/' . $nickname . '/home', - 'sel' => ((argv(0) == 'webpages') ? 'active' : ''), - 'title' => t('View Webpages'), - 'id' => 'webpages-tab', - 'icon' => 'newspaper-o' - ); - } - - - if ($p['view_wiki']) { - if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) { - $tabs[] = array( - 'label' => t('Wikis'), - 'url' => z_root() . '/wiki/' . $nickname, - 'sel' => ((argv(0) == 'wiki') ? 'active' : ''), - 'title' => t('Wiki'), - 'id' => 'wiki-tab', - 'icon' => 'pencil-square-o' - ); - } - } - - $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs); - call_hooks('profile_tabs', $arr); - - $tpl = get_markup_template('profile_tabs.tpl'); - - return replace_macros($tpl, array( - '$tabs' => $arr['tabs'], - '$name' => App::$profile['channel_name'], - '$thumb' => App::$profile['thumb'] - )); -} - - function get_responses($conv_responses,$response_verbs,$ob,$item) { $ret = array(); diff --git a/include/features.php b/include/features.php index 03f50c9a4..5479be122 100644 --- a/include/features.php +++ b/include/features.php @@ -81,24 +81,6 @@ function get_features($filtered = true, $level = (-1)) { get_config('feature_lock','profile_export'), feature_level('profile_export',3), ], - - [ - 'webpages', - t('Web Pages'), - t('Provide managed web pages on your channel'), - false, - get_config('feature_lock','webpages'), - feature_level('webpages',3), - ], - - [ - 'wiki', - t('Wiki'), - t('Provide a wiki for your channel'), - false, - get_config('feature_lock','wiki'), - feature_level('wiki',2), - ], /* [ 'hide_rating', @@ -119,25 +101,6 @@ function get_features($filtered = true, $level = (-1)) { ], [ - 'cards', - t('Cards'), - t('Create personal planning cards'), - false, - get_config('feature_lock','cards'), - feature_level('cards',1), - ], - - - [ - 'articles', - t('Articles'), - t('Create interactive articles'), - false, - get_config('feature_lock','articles'), - feature_level('articles',1), - ], - - [ 'nav_channel_select', t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu'), @@ -156,16 +119,6 @@ function get_features($filtered = true, $level = (-1)) { ], [ - 'ajaxchat', - t('Access Controlled Chatrooms'), - t('Provide chatrooms and chat services with access control.'), - true, - get_config('feature_lock','ajaxchat'), - feature_level('ajaxchat',1), - ], - - - [ 'smart_birthdays', t('Smart Birthdays'), t('Make birthday events timezone aware in case your friends are scattered across the planet.'), diff --git a/include/import.php b/include/import.php index 91a26b23b..0fc24a26f 100644 --- a/include/import.php +++ b/include/import.php @@ -93,7 +93,8 @@ function import_channel($channel, $account_id, $seize, $newname = '') { 'channel_w_comment', 'channel_w_mail', 'channel_w_like', 'channel_w_tagwall', 'channel_w_chat', 'channel_w_storage', 'channel_w_pages', 'channel_a_republish', 'channel_a_delegate', 'perm_limits', 'channel_password', 'channel_salt', - 'channel_moved' + 'channel_moved', 'channel_primary', 'channel_removed', 'channel_deleted', + 'channel_system' ]; $clean = array(); diff --git a/include/items.php b/include/items.php index b0f6a89cf..c817c5afb 100755 --- a/include/items.php +++ b/include/items.php @@ -3997,6 +3997,7 @@ function zot_feed($uid, $observer_hash, $arr) { $result = array(); $mindate = null; $message_id = null; + $wall = true; require_once('include/security.php'); @@ -4008,6 +4009,10 @@ function zot_feed($uid, $observer_hash, $arr) { $message_id = $arr['message_id']; } + if(array_key_exists('wall',$arr)) { + $wall = intval($arr['wall']); + } + if(! $mindate) $mindate = NULL_DATE; @@ -4036,6 +4041,10 @@ function zot_feed($uid, $observer_hash, $arr) { $limit = ''; } + if($wall) { + $sql_extra .= " and item_wall = 1 "; + } + $items = []; @@ -4048,7 +4057,6 @@ function zot_feed($uid, $observer_hash, $arr) { $r = q("SELECT parent, postopts FROM item WHERE uid IN ( %s ) - AND item_wall = 1 AND item_private = 0 $item_normal $sql_extra ORDER BY created ASC $limit", @@ -4058,7 +4066,6 @@ function zot_feed($uid, $observer_hash, $arr) { else { $r = q("SELECT parent, postopts FROM item WHERE uid = %d - AND item_wall = 1 $item_normal $sql_extra ORDER BY created ASC $limit", intval($uid) diff --git a/include/markdown.php b/include/markdown.php index e5f5b9369..0d810764f 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -295,6 +295,8 @@ function bb_to_markdown($Text, $options = []) { */ function html2markdown($html,$options = []) { $markdown = ''; + + $html = htmlspecialchars($html); $environment = Environment::createDefaultEnvironment($options); $environment->addConverter(new TableConverter()); diff --git a/include/nav.php b/include/nav.php index 56fe9b901..9afba7945 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,11 +1,11 @@ <?php /** @file */ -use \Zotlabs\Lib as Zlib; +use \Zotlabs\Lib\Apps; +use \Zotlabs\Lib\Chatroom; require_once('include/security.php'); require_once('include/menu.php'); - function nav($template = 'default') { /** @@ -213,26 +213,26 @@ function nav($template = 'default') { //app bin if($is_owner) { if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) { - Zlib\Apps::import_system_apps(); + Apps::import_system_apps(); set_pconfig(local_channel(), 'system','import_system_apps', datetime_convert('UTC','UTC','now','Y-m-d')); } $syslist = array(); - $list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); + $list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); if($list) { foreach($list as $li) { - $syslist[] = Zlib\Apps::app_encode($li); + $syslist[] = Apps::app_encode($li); } } - Zlib\Apps::translate_system_apps($syslist); + Apps::translate_system_apps($syslist); } else { - $syslist = Zlib\Apps::get_system_apps(true); + $syslist = Apps::get_system_apps(true); } usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); - $syslist = Zlib\Apps::app_order(local_channel(),$syslist); + $syslist = Apps::app_order(local_channel(),$syslist); foreach($syslist as $app) { if(\App::$nav_sel['name'] == $app['name']) @@ -240,18 +240,18 @@ function nav($template = 'default') { if($is_owner) { if(strpos($app['categories'],'nav_pinned_app') !== false) { - $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); + $navbar_apps[] = Apps::app_render($app,'navbar'); } else { - $nav_apps[] = Zlib\Apps::app_render($app,'nav'); + $nav_apps[] = Apps::app_render($app,'nav'); } } elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { if(strpos($app['categories'],'nav_pinned_app') !== false) { - $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); + $navbar_apps[] = Apps::app_render($app,'navbar'); } else { - $nav_apps[] = Zlib\Apps::app_render($app,'nav'); + $nav_apps[] = Apps::app_render($app,'nav'); } } } @@ -314,12 +314,10 @@ function nav($template = 'default') { function nav_set_selected($item){ App::$nav_sel['raw_name'] = $item; $item = ['name' => $item]; - Zlib\Apps::translate_system_apps($item); + Apps::translate_system_apps($item); App::$nav_sel['name'] = $item['name']; } - - function channel_apps($is_owner = false, $nickname = null) { // Don't provide any channel apps if we're running as the sys channel @@ -419,8 +417,8 @@ function channel_apps($is_owner = false, $nickname = null) { } - if ($p['chat'] && feature_enabled($uid,'ajaxchat')) { - $has_chats = ZLib\Chatroom::list_count($uid); + if ($p['chat'] && Apps::system_app_installed($uid,'Chatrooms')) { + $has_chats = Chatroom::list_count($uid); if ($has_chats) { $tabs[] = [ 'label' => t('Chatrooms'), @@ -445,7 +443,7 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if($p['view_pages'] && feature_enabled($uid,'cards')) { + if($p['view_pages'] && Apps::system_app_installed($uid, 'Cards')) { $tabs[] = [ 'label' => t('Cards'), 'url' => z_root() . '/cards/' . $nickname , @@ -456,7 +454,7 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if($p['view_pages'] && feature_enabled($uid,'articles')) { + if($p['view_pages'] && Apps::system_app_installed($uid, 'Articles')) { $tabs[] = [ 'label' => t('Articles'), 'url' => z_root() . '/articles/' . $nickname , @@ -468,7 +466,7 @@ function channel_apps($is_owner = false, $nickname = null) { } - if($has_webpages && feature_enabled($uid,'webpages')) { + if($has_webpages && Apps::system_app_installed($uid, 'Webpages')) { $tabs[] = [ 'label' => t('Webpages'), 'url' => z_root() . '/page/' . $nickname . '/home', @@ -480,21 +478,19 @@ function channel_apps($is_owner = false, $nickname = null) { } - if ($p['view_wiki']) { - if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) { - $tabs[] = [ - 'label' => t('Wikis'), - 'url' => z_root() . '/wiki/' . $nickname, - 'sel' => ((argv(0) == 'wiki') ? 'active' : ''), - 'title' => t('Wiki'), - 'id' => 'wiki-tab', - 'icon' => 'pencil-square-o' - ]; - } + if ($p['view_wiki'] && Apps::system_app_installed($uid, 'Wiki')) { + $tabs[] = [ + 'label' => t('Wikis'), + 'url' => z_root() . '/wiki/' . $nickname, + 'sel' => ((argv(0) == 'wiki') ? 'active' : ''), + 'title' => t('Wiki'), + 'id' => 'wiki-tab', + 'icon' => 'pencil-square-o' + ]; } $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs); - call_hooks('profile_tabs', $arr); + call_hooks('channel_apps', $arr); return replace_macros(get_markup_template('profile_tabs.tpl'), diff --git a/include/network.php b/include/network.php index d4f4f27c6..5ae02deff 100644 --- a/include/network.php +++ b/include/network.php @@ -157,7 +157,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307 || $http_code == 308) { $matches = array(); - preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches); + preg_match('/(Location:|URI:)(.*?)\n/i', $header, $matches); $newurl = trim(array_pop($matches)); if(strpos($newurl,'/') === 0) $newurl = $url . $newurl; diff --git a/include/zot.php b/include/zot.php index e8ac2df02..b29e86dfa 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3573,13 +3573,13 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } $disallowed = [ - 'channel_id', 'channel_account_id', 'channel_primary', 'channel_prvkey', - 'channel_address', 'channel_notifyflags', 'channel_removed', 'channel_deleted', - 'channel_system', 'channel_r_stream', 'channel_r_profile', 'channel_r_abook', - 'channel_r_storage', 'channel_r_pages', 'channel_w_stream', 'channel_w_wall', - 'channel_w_comment', 'channel_w_mail', 'channel_w_like', 'channel_w_tagwall', - 'channel_w_chat', 'channel_w_storage', 'channel_w_pages', 'channel_a_republish', - 'channel_a_delegate' + 'channel_id', 'channel_account_id', 'channel_primary', 'channel_prvkey', + 'channel_address', 'channel_notifyflags', 'channel_removed', 'channel_deleted', + 'channel_system', 'channel_r_stream', 'channel_r_profile', 'channel_r_abook', + 'channel_r_storage', 'channel_r_pages', 'channel_w_stream', 'channel_w_wall', + 'channel_w_comment', 'channel_w_mail', 'channel_w_like', 'channel_w_tagwall', + 'channel_w_chat', 'channel_w_storage', 'channel_w_pages', 'channel_a_republish', + 'channel_a_delegate', 'channel_moved' ]; $clean = array(); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 7fd2cfea8..9b78ae8d4 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -736,6 +736,17 @@ CREATE TABLE IF NOT EXISTS `likes` ( KEY `target_id` (`target_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS listeners ( + id int(11) NOT NULL AUTO_INCREMENT, + target_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + portable_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + ltype int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY target_id (target_id), + KEY portable_id (portable_id), + KEY ltype (ltype) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + CREATE TABLE IF NOT EXISTS `mail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `convid` int(10) unsigned NOT NULL DEFAULT 0 , diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 68c65c830..7f118646e 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -718,6 +718,17 @@ create index "likes_i_mid" on likes ("i_mid"); create index "likes_verb" on likes ("verb"); create index "likes_target_type" on likes ("target_type"); create index "likes_target_id" on likes ("target_id"); +CREATE TABLE listeners ( + id serial NOT NULL, + target_id text NOT NULL, + portable_id text NOT NULL, + ltype smallint NOT NULL DEFAULT '0', + PRIMARY KEY (id) +); +create index "target_id_idx" on listeners ("target_id"); +create index "portable_id_idx" on listeners ("portable_id"); +create index "ltype_idx" on listeners ("ltype"); + CREATE TABLE "mail" ( "id" serial NOT NULL, "convid" bigint NOT NULL DEFAULT '0', diff --git a/util/php2po.php b/util/php2po.php index c710b86fe..ca33f8b01 100644 --- a/util/php2po.php +++ b/util/php2po.php @@ -35,7 +35,7 @@ if (!preg_match("/^msgstr\[[1-9]/",$l)) { if ($k!="" && (substr($l,0,7)=="msgstr " || substr($l,0,8)=="msgstr[0")){ $ink = False; - $k = stripslashes($k); + $k = stripcslashes($k); $v = ""; if (isset(App::$strings[$k])) { $v = App::$strings[$k]; diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl index e8af6f6dc..7739d24b8 100755 --- a/view/tpl/cover_photo_widget.tpl +++ b/view/tpl/cover_photo_widget.tpl @@ -3,65 +3,57 @@ var section_padding_top; var coverSlid = false; var hide_cover = Boolean({{$hide_cover}}); + var cover_height; $(document).ready(function() { if(! $('#cover-photo').length) return; - aside_padding_top = parseInt($('aside').css('padding-top')); - section_padding_top = parseInt($('section').css('padding-top')); - - $(document).on('click mouseup keyup', slideUpCover); + if($(window).width() < 755) { + $('#cover-photo').remove(); + coverSlid = true; + return; + } - if($(window).width() > 755) { - $('#cover-photo').removeClass('d-none'); - datasrc2src('#cover-photo > img'); + $('#cover-photo').removeClass('d-none'); + cover_height = Math.ceil($(window).width()/2.75862069); + $('#cover-photo').css('height', cover_height + 'px'); + datasrc2src('#cover-photo > img'); - if(hide_cover) { - hideCover(); - } + $(document).on('click mouseup keyup', slideUpCover); - if($(window).scrollTop() < $('#cover-photo').height()) { - $('body').css('cursor', 'n-resize'); - $('.navbar').removeClass('fixed-top'); - $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); - $('main').css('opacity', 0); - } + if(hide_cover) { + hideCover(); } - else { - $('#cover-photo').remove(); - coverSlid = true; + else if(!hide_cover && !coverSlid) { + coverVisibleActions(); } }); $(window).scroll(function () { - if($(window).width() > 755 && $(window).scrollTop() > $('#cover-photo').height()) { - $('body').css('cursor', ''); - $('.navbar').addClass('fixed-top'); - $('main').css('margin-top', ''); - $('main').css('opacity', 1); + if($(window).scrollTop() >= cover_height) { + coverHiddenActions(); coverSlid = true; } - else if ($(window).width() > 755 && $(window).scrollTop() < $('#cover-photo').height()){ + else if ($(window).scrollTop() < cover_height){ if(coverSlid) { - $(window).scrollTop(Math.ceil($('#cover-photo').height())); + $(window).scrollTop(cover_height); setTimeout(function(){ coverSlid = false; }, 1000); } else { - if($(window).scrollTop() < $('#cover-photo').height()) { - $('body').css('cursor', 'n-resize'); - $('.navbar').removeClass('fixed-top'); - $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); - $('main').css('opacity', 0); + if($(window).scrollTop() < cover_height) { + coverVisibleActions(); } } } if($('main').css('opacity') < 1) { - $('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1)); + $('main').css('opacity', ($(window).scrollTop()/cover_height).toFixed(1)); } }); $(window).resize(function () { + cover_height = Math.ceil($(window).width()/2.75862069); + $('#cover-photo').css('height', cover_height + 'px'); if($(window).width() < 755) { $('#cover-photo').remove(); $('.navbar').addClass('fixed-top'); @@ -75,7 +67,7 @@ if(coverSlid) { return; } - $('html, body').animate({scrollTop: Math.ceil($('#cover-photo').height()) + 'px' }, 'fast'); + $('html, body').animate({scrollTop: cover_height + 'px'}, 'fast'); return; } @@ -83,7 +75,22 @@ if(coverSlid) { return; } - window.scrollTo(0, Math.ceil($('#cover-photo').height())); + window.scrollTo(0, cover_height); + return; + } + + function coverVisibleActions() { + $('body').css('cursor', 'n-resize'); + $('.navbar').removeClass('fixed-top'); + $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); + $('main').css('opacity', 0); + } + + function coverHiddenActions() { + $('body').css('cursor', ''); + $('.navbar').addClass('fixed-top'); + $('main').css('margin-top', ''); + $('main').css('opacity', 1); } </script> diff --git a/view/tpl/follow.tpl b/view/tpl/follow.tpl index 2fb753784..bccb25068 100755 --- a/view/tpl/follow.tpl +++ b/view/tpl/follow.tpl @@ -2,7 +2,7 @@ <h3>{{$connect}}</h3> <form action="follow" method="post" /> <div class="input-group"> - <input class="form-control form-control-sm" type="text" name="url" title="{{$hint}}" placeholder="{{$desc}}" /> + <input class="form-control" type="text" name="url" title="{{$hint}}" placeholder="{{$desc}}" /> <div class="input-group-append"> <button class="btn btn-success" type="submit" name="submit" value="{{$follow}}" title="{{$follow}}"><i class="fa fa-fw fa-plus"></i></button> </div> diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index b4d9ef19f..206be694e 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -2,7 +2,7 @@ <h3>{{$findpeople}}</h3> <form action="directory" method="post" /> <div class="input-group form-group"> - <input class="form-control form-control-sm" type="text" name="search" title="{{$hint}}{{if $advanced_search}}{{$advanced_hint}}{{/if}}" placeholder="{{$desc}}" /> + <input class="form-control" type="text" name="search" title="{{$hint}}{{if $advanced_search}}{{$advanced_hint}}{{/if}}" placeholder="{{$desc}}" /> <div class="input-group-append"> <button class="btn btn-outline-secondary" type="submit" name="submit"><i class="fa fa-fw fa-search"></i></button> </div> diff --git a/view/tpl/searchbox.tpl b/view/tpl/searchbox.tpl index abcdb8933..2fcf3e374 100644 --- a/view/tpl/searchbox.tpl +++ b/view/tpl/searchbox.tpl @@ -1,7 +1,7 @@ <form action="{{$action_url}}" method="get" > <input type="hidden" name="f" value="" /> <div id="{{$id}}" class="input-group"> - <input class="form-control form-control-sm" type="text" name="search" id="search-text" value="{{$s}}" onclick="this.submit();" /> + <input class="form-control" type="text" name="search" id="search-text" value="{{$s}}" onclick="this.submit();" /> <div class="input-group-append"> <button type="submit" name="submit" class="btn btn-outline-secondary" id="search-submit" value="{{$search_label}}"><i class="fa fa-search"></i></button> {{if $savedsearch}} diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 0f725749f..2aabc7b5f 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -66,7 +66,7 @@ {{if $showPageControls}} <div id="id_{{$commitMsg.0}}_wrapper" class="field input" style="display: none"> <div class="input-group"> - <input class="form-control form-control-sm" name="{{$commitMsg.0}}" id="id_{{$commitMsg.0}}" type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> + <input class="form-control" name="{{$commitMsg.0}}" id="id_{{$commitMsg.0}}" type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> <div class="input-group-append"> <button id="save-page" type="button" class="btn btn-primary disabled">Save</button> </div> |