remove profile_tabs() which has been deprecated and replaced by channel_apps()

This commit is contained in:
Mario Vavti 2018-09-13 10:59:37 +02:00
parent 78dc679a72
commit a1d5ce3716
12 changed files with 5 additions and 219 deletions

View File

@ -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">';

View File

@ -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(); }

View File

@ -212,7 +212,6 @@ class Chat extends \Zotlabs\Web\Controller {
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')) {

View File

@ -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

View File

@ -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(

View File

@ -159,7 +159,7 @@ class Webpages extends Controller {
$is_owner = ($uid && $uid == $owner);
//$o = profile_tabs($a, $is_owner, App::$profile['channel_address']);
$o = '';
$x = array(

View File

@ -118,7 +118,7 @@ class Wiki extends 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

View File

@ -1 +0,0 @@
[h2]profile_tabs[/h2]

View File

@ -535,9 +535,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

File diff suppressed because one or more lines are too long

View File

@ -1757,206 +1757,6 @@ function network_tabs() {
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();

View File

@ -490,7 +490,7 @@ function channel_apps($is_owner = false, $nickname = null) {
}
$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'),