]> git.mxchange.org Git - friendica.git/commitdiff
Several default features are now in the core
authorMichael <heluecht@pirati.ca>
Sun, 18 Nov 2018 20:13:46 +0000 (20:13 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 18 Nov 2018 20:13:46 +0000 (20:13 +0000)
include/conversation.php
mod/network.php
mod/photos.php
mod/ping.php
mod/search.php
src/Content/Feature.php
src/Content/ForumManager.php
src/Content/Text/HTML.php
src/Content/Widget.php
src/Object/Post.php

index ee286ca98331eb6ec8c3d5460b8f8ddaaeb884bc..1b7b34e71ad2938280b2e92f8fe89edb7cb92d1c 100644 (file)
@@ -769,7 +769,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                '$mode' => $mode,
                '$user' => $a->user,
                '$threads' => $threads,
-               '$dropping' => ($page_dropping && Feature::isEnabled(local_user(), 'multi_delete') ? L10n::t('Delete Selected Items') : False),
+               '$dropping' => ($page_dropping ? L10n::t('Delete Selected Items') : False),
        ]);
 
        return $o;
@@ -1163,7 +1163,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$lockstate'    => $x['lockstate'],
                '$bang'         => $x['bang'],
                '$profile_uid'  => $x['profile_uid'],
-               '$preview'      => Feature::isEnabled($x['profile_uid'], 'preview') ? L10n::t('Preview') : '',
+               '$preview'      => L10n::t('Preview'),
                '$jotplugins'   => $jotplugins,
                '$notes_cid'    => $notes_cid,
                '$sourceapp'    => L10n::t($a->sourcename),
index ba02ee5cc326dbf8dd88cf0a3b2a312f34f21b77..58f9484250f2cd8e8f41f808948b7b1be5bdd48f 100644 (file)
@@ -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()
                ]);
        }
-}
\ No newline at end of file
+}
index f07815c2582583d4be1c025ee0f02e586a8ed3f4..65a48c4c3f4995e26d82b2b94372c96eff461650 100644 (file)
@@ -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);
index 6f5b5b4a9828aeed4a79c628f6e0213f2cafb3ec..edc1a1121345cc568079ee2fd3f6a1738442bf37 100644 (file)
@@ -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;
                                        }
                                }
                        }
index f552ad43c77236ed2142d260dce8eeed8ca08d11..1ada76a9e6ee9d961d5d3da739e0d3836764c9c4 100644 (file)
@@ -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())
        );
index f6d64803454950d290043de4fbdecc30389eff34..446ea2705ca42bd64d407443f2220026258efcfd 100644 (file)
@@ -86,7 +86,6 @@ class Feature
                        // Post composition
                        'composition' => [
                                L10n::t('Post Composition Features'),
-                               ['preview',        L10n::t('Post Preview'),        L10n::t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
                                ['aclautomention', L10n::t('Auto-mention Forums'), L10n::t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
                        ],
 
@@ -94,16 +93,12 @@ class Feature
                        'widgets' => [
                                L10n::t('Network Sidebar'),
                                ['archives',         L10n::t('Archives'), L10n::t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
-                               ['forumlist_widget', L10n::t('List Forums'),    L10n::t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
-                               ['groups',           L10n::t('Group Filter'),   L10n::t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
                                ['networks',         L10n::t('Protocol Filter'), L10n::t('Enable widget to display Network posts only from selected protocols'), false, Config::get('feature_lock', 'networks', false)],
-                               ['savedsearch',      L10n::t('Saved Searches'), L10n::t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
                        ],
 
                        // Network tabs
                        'net_tabs' => [
                                L10n::t('Network Tabs'),
-                               ['personal_tab', L10n::t('Network Personal Tab'),     L10n::t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
                                ['new_tab',      L10n::t('Network New Tab'),          L10n::t("Enable tab to display only new Network posts \x28from the last 12 hours\x29"), false, Config::get('feature_lock', 'new_tab', false)],
                                ['link_tab',     L10n::t('Network Shared Links Tab'), L10n::t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
                        ],
@@ -111,14 +106,7 @@ class Feature
                        // Item tools
                        'tools' => [
                                L10n::t('Post/Comment Tools'),
-                               ['multi_delete', L10n::t('Multiple Deletion'),       L10n::t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
-                               ['edit_posts',   L10n::t('Edit Sent Posts'),         L10n::t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
-                               ['commtag',      L10n::t('Tagging'),                 L10n::t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
                                ['categories',   L10n::t('Post Categories'),         L10n::t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
-                               ['filing',       L10n::t('Saved Folders'),           L10n::t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
-                               ['dislike',      L10n::t('Dislike Posts'),           L10n::t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
-                               ['star_posts',   L10n::t('Star Posts'),              L10n::t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
-                               ['ignore_posts', L10n::t('Mute Post Notifications'), L10n::t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
                        ],
 
                        // Advanced Profile Settings
index 97917cfd2a9911b5b6c703af9a9197e720785985..7b947359a6521a246b1ebcba64e3f35f4ffb0f9d 100644 (file)
@@ -93,10 +93,6 @@ class ForumManager
         */
        public static function widget($uid, $cid = 0)
        {
-               if (! intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
-                       return;
-               }
-
                $o = '';
 
                //sort by last updated item
index 9b73da56df2e4dc2f2a03817aca5b944cc8fe915..544811536bc8e52577b3598be907ba4d49583316 100644 (file)
@@ -966,7 +966,7 @@ class HTML
                                '$action_url' => $url,
                                '$search_label' => L10n::t('Search'),
                                '$save_label' => $save_label,
-                               '$savedsearch' => local_user() && Feature::isEnabled(local_user(), 'savedsearch'),
+                               '$savedsearch' => 'savedsearch',
                                '$search_hint' => L10n::t('@name, !forum, #tags, content'),
                                '$mode' => $mode
                        ];
index ab9bb8882893f148868b490363c36eadc1ef8a3c..d4d4ff54949ae974ffad4c05b33f9f60fd88eea8 100644 (file)
@@ -176,10 +176,6 @@ class Widget
                        return '';
                }
 
-               if (!Feature::isEnabled(local_user(), 'filing')) {
-                       return '';
-               }
-
                $saved = PConfig::get(local_user(), 'system', 'filetags');
                if (!strlen($saved)) {
                        return;
index 58b11a723cb9c830e079364fa30b928671b4eafa..8b17a3b85e6177400cbbd21eea7e9757095597bd 100644 (file)
@@ -157,6 +157,8 @@ class Post extends BaseObject
 
                $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
 
+               $edpost = false;
+
                if (local_user()) {
                        if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
                                if ($item["event-id"] != 0) {
@@ -166,8 +168,6 @@ class Post extends BaseObject
                                }
                        }
                        $dropping = in_array($item['uid'], [0, local_user()]);
-               } else {
-                       $edpost = false;
                }
 
                // Editing on items of not subscribed users isn't currently possible
@@ -202,7 +202,7 @@ class Post extends BaseObject
 
                $drop = [
                        'dropping' => $dropping,
-                       'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
+                       'pagedrop' => $item['pagedrop'],
                        'select'   => L10n::t('Select'),
                        'delete'   => $delete,
                ];
@@ -294,12 +294,10 @@ class Post extends BaseObject
                                        'starred'   => L10n::t('starred'),
                                ];
 
-                               if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
-                                       $tagger = [
-                                               'add'   => L10n::t("add tag"),
-                                               'class' => "",
-                                       ];
-                               }
+                               $tagger = [
+                                       'add'   => L10n::t("add tag"),
+                                       'class' => "",
+                               ];
                        }
                } else {
                        $indent = 'comment';
@@ -308,7 +306,7 @@ class Post extends BaseObject
                if ($conv->isWritable()) {
                        $buttons = [
                                'like'    => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
-                               'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")] : '',
+                               'dislike' => [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")],
                        ];
                        if ($shareable) {
                                $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
@@ -401,12 +399,12 @@ class Post extends BaseObject
                        'owner_photo'     => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
                        'owner_name'      => htmlentities($owner_name_e),
                        'plink'           => Item::getPlink($item),
-                       'edpost'          => Feature::isEnabled($conv->getProfileOwner(), 'edit_posts') ? $edpost : '',
+                       'edpost'          => $edpost,
                        'isstarred'       => $isstarred,
-                       'star'            => Feature::isEnabled($conv->getProfileOwner(), 'star_posts') ? $star : '',
-                       'ignore'          => Feature::isEnabled($conv->getProfileOwner(), 'ignore_posts') ? $ignore : '',
+                       'star'            => $star,
+                       'ignore'          => $ignore,
                        'tagger'          => $tagger,
-                       'filer'           => Feature::isEnabled($conv->getProfileOwner(), 'filing') ? $filer : '',
+                       'filer'           => $filer,
                        'drop'            => $drop,
                        'vote'            => $buttons,
                        'like'            => $responses['like']['output'],
@@ -820,7 +818,7 @@ class Post extends BaseObject
                                '$edurl'       => L10n::t('Link'),
                                '$edattach'    => L10n::t('Link or Media'),
                                '$prompttext'  => L10n::t('Please enter a image/video/audio/webpage URL:'),
-                               '$preview'     => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? L10n::t('Preview') : ''),
+                               '$preview'     => L10n::t('Preview'),
                                '$indent'      => $indent,
                                '$sourceapp'   => L10n::t($a->sourcename),
                                '$ww'          => $conv->getMode() === 'network' ? $ww : '',