Several default features are now in the core
This commit is contained in:
parent
75398b96d5
commit
43079bfaf8
10 changed files with 48 additions and 88 deletions
|
@ -160,9 +160,8 @@ function network_init(App $a)
|
|||
$a->page['aside'] = '';
|
||||
}
|
||||
|
||||
$a->page['aside'] .= (Feature::isEnabled(local_user(), 'groups') ?
|
||||
Group::sidebarWidget('network/0', 'network', 'standard', $group_id) : '');
|
||||
$a->page['aside'] .= (Feature::isEnabled(local_user(), 'forumlist_widget') ? ForumManager::widget(local_user(), $cid) : '');
|
||||
$a->page['aside'] .= Group::sidebarWidget('network/0', 'network', 'standard', $group_id);
|
||||
$a->page['aside'] .= ForumManager::widget(local_user(), $cid);
|
||||
$a->page['aside'] .= posted_date_widget('network', local_user(), false);
|
||||
$a->page['aside'] .= Widget::networks('network', (x($_GET, 'nets') ? $_GET['nets'] : ''));
|
||||
$a->page['aside'] .= saved_searches($search);
|
||||
|
@ -171,10 +170,6 @@ function network_init(App $a)
|
|||
|
||||
function saved_searches($search)
|
||||
{
|
||||
if (!Feature::isEnabled(local_user(), 'savedsearch')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$a = get_app();
|
||||
|
||||
$srchurl = '/network?f='
|
||||
|
@ -993,16 +988,14 @@ function network_tabs(App $a)
|
|||
],
|
||||
];
|
||||
|
||||
if (Feature::isEnabled(local_user(), 'personal_tab')) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Personal'),
|
||||
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
|
||||
'sel' => $conv_active,
|
||||
'title' => L10n::t('Posts that mention or involve you'),
|
||||
'id' => 'personal-tab',
|
||||
'accesskey' => 'r',
|
||||
];
|
||||
}
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Personal'),
|
||||
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
|
||||
'sel' => $conv_active,
|
||||
'title' => L10n::t('Posts that mention or involve you'),
|
||||
'id' => 'personal-tab',
|
||||
'accesskey' => 'r',
|
||||
];
|
||||
|
||||
if (Feature::isEnabled(local_user(), 'new_tab')) {
|
||||
$tabs[] = [
|
||||
|
@ -1026,16 +1019,14 @@ function network_tabs(App $a)
|
|||
];
|
||||
}
|
||||
|
||||
if (Feature::isEnabled(local_user(), 'star_posts')) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Starred'),
|
||||
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
|
||||
'sel' => $starred_active,
|
||||
'title' => L10n::t('Favourite Posts'),
|
||||
'id' => 'starred-posts-tab',
|
||||
'accesskey' => 'm',
|
||||
];
|
||||
}
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Starred'),
|
||||
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
|
||||
'sel' => $starred_active,
|
||||
'title' => L10n::t('Favourite Posts'),
|
||||
'id' => 'starred-posts-tab',
|
||||
'accesskey' => 'm',
|
||||
];
|
||||
|
||||
// save selected tab, but only if not in file mode
|
||||
if (!x($_GET, 'file')) {
|
||||
|
@ -1079,4 +1070,4 @@ function network_infinite_scroll_head(App $a, &$htmlhead)
|
|||
'$reload_uri' => $pager->getBaseQueryString()
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1480,7 +1480,7 @@ function photos_content(App $a)
|
|||
$likebuttons = Renderer::replaceMacros($like_tpl, [
|
||||
'$id' => $link_item['id'],
|
||||
'$likethis' => L10n::t("I like this \x28toggle\x29"),
|
||||
'$nolike' => (Feature::isEnabled(local_user(), 'dislike') ? L10n::t("I don't like this \x28toggle\x29") : ''),
|
||||
'$nolike' => L10n::t("I don't like this \x28toggle\x29"),
|
||||
'$wait' => L10n::t('Please wait'),
|
||||
'$return_path' => $a->query_string,
|
||||
]);
|
||||
|
@ -1607,9 +1607,7 @@ function photos_content(App $a)
|
|||
}
|
||||
}
|
||||
$response_verbs = ['like'];
|
||||
if (Feature::isEnabled($owner_uid, 'dislike')) {
|
||||
$response_verbs[] = 'dislike';
|
||||
}
|
||||
$response_verbs[] = 'dislike';
|
||||
$responses = get_responses($conv_responses, $response_verbs, '', $link_item);
|
||||
|
||||
$paginate = $pager->renderFull($total);
|
||||
|
|
26
mod/ping.php
26
mod/ping.php
|
@ -150,25 +150,21 @@ function ping_init(App $a)
|
|||
}
|
||||
|
||||
if ($network_count) {
|
||||
if (intval(Feature::isEnabled(local_user(), 'groups'))) {
|
||||
// Find out how unseen network posts are spread across groups
|
||||
$group_counts = Group::countUnseen();
|
||||
if (DBA::isResult($group_counts)) {
|
||||
foreach ($group_counts as $group_count) {
|
||||
if ($group_count['count'] > 0) {
|
||||
$groups_unseen[] = $group_count;
|
||||
}
|
||||
// Find out how unseen network posts are spread across groups
|
||||
$group_counts = Group::countUnseen();
|
||||
if (DBA::isResult($group_counts)) {
|
||||
foreach ($group_counts as $group_count) {
|
||||
if ($group_count['count'] > 0) {
|
||||
$groups_unseen[] = $group_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
|
||||
$forum_counts = ForumManager::countUnseenItems();
|
||||
if (DBA::isResult($forum_counts)) {
|
||||
foreach ($forum_counts as $forum_count) {
|
||||
if ($forum_count['count'] > 0) {
|
||||
$forums_unseen[] = $forum_count;
|
||||
}
|
||||
$forum_counts = ForumManager::countUnseenItems();
|
||||
if (DBA::isResult($forum_counts)) {
|
||||
foreach ($forum_counts as $forum_count) {
|
||||
if ($forum_count['count'] > 0) {
|
||||
$forums_unseen[] = $forum_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,6 @@ function search_saved_searches() {
|
|||
$o = '';
|
||||
$search = ((x($_GET,'search')) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
|
||||
|
||||
if (!Feature::isEnabled(local_user(),'savedsearch'))
|
||||
return $o;
|
||||
|
||||
$r = q("SELECT `id`,`term` FROM `search` WHERE `uid` = %d",
|
||||
intval(local_user())
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue