]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
missing use and self
[friendica.git] / include / conversation.php
index 9e813b5eb07ec6cccb14fa6831175efea87d4391..47adfc0dfbf971dec2677a46669d091b9db249e7 100644 (file)
@@ -6,10 +6,12 @@
 use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Content\Feature;
+use Friendica\Content\Pager;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
@@ -354,7 +356,7 @@ function localize_item(&$item)
                'network' => $item['author-network'], 'url' => $item['author-link']];
 
        // Only create a redirection to a magic link when logged in
-       if (!empty($item['plink']) && local_user()) {
+       if (!empty($item['plink']) && (local_user() || remote_user())) {
                $item['plink'] = Contact::magicLinkbyContact($author, $item['plink']);
        }
 }
@@ -433,8 +435,8 @@ function conv_get_blocklist()
  * that are based on unique features of the calling module.
  *
  */
-function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) {
-
+function conversation(App $a, array $items, Pager $pager, $mode, $update, $preview = false, $order = 'commented', $uid = 0)
+{
        $ssl_state = (local_user() ? true : false);
 
        $profile_owner = 0;
@@ -469,7 +471,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                                . ((x($_GET, 'cmax'))   ? '&cmax='   . $_GET['cmax']   : '')
                                . ((x($_GET, 'file'))   ? '&file='   . $_GET['file']   : '')
 
-                               . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+                               . "'; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                }
        } elseif ($mode === 'profile') {
                $items = conversation_add_children($items, false, $order, $uid);
@@ -488,7 +490,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
 
                                $live_update_div = '<div id="live-profile"></div>' . "\r\n"
                                        . "<script> var profile_uid = " . $a->profile['profile_uid']
-                                       . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+                                       . "; var netargs = '?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                        }
                }
        } elseif ($mode === 'notes') {
@@ -498,7 +500,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                if (!$update) {
                        $live_update_div = '<div id="live-notes"></div>' . "\r\n"
                                . "<script> var profile_uid = " . local_user()
-                               . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+                               . "; var netargs = '/?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                }
        } elseif ($mode === 'display') {
                $items = conversation_add_children($items, false, $order, $uid);
@@ -516,7 +518,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                if (!$update) {
                        $live_update_div = '<div id="live-community"></div>' . "\r\n"
                                . "<script> var profile_uid = -1; var netargs = '" . substr($a->cmd, 10)
-                               ."/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+                               ."/?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                }
        } elseif ($mode === 'contacts') {
                $items = conversation_add_children($items, true, $order, $uid);
@@ -525,7 +527,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                if (!$update) {
                        $live_update_div = '<div id="live-contacts"></div>' . "\r\n"
                                . "<script> var profile_uid = -1; var netargs = '" . substr($a->cmd, 9)
-                               ."/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+                               ."/?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                }
        } elseif ($mode === 'search') {
                $live_update_div = '<div id="live-search"></div>' . "\r\n";
@@ -534,7 +536,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
        $page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
 
        if (!$update) {
-               $_SESSION['return_url'] = $a->query_string;
+               $_SESSION['return_path'] = $a->query_string;
        }
 
        $cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
@@ -750,7 +752,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
 
                        $threads = $conv->getTemplateData($conv_responses);
                        if (!$threads) {
-                               logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
+                               Logger::log('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
                                $threads = [];
                        }
                }
@@ -1083,9 +1085,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$geotag'    => $geotag,
                '$nickname'  => $x['nickname'],
                '$ispublic'  => L10n::t('Visible to <strong>everybody</strong>'),
-               '$linkurl'   => L10n::t('Please enter a link URL:'),
-               '$vidurl'    => L10n::t("Please enter a video link/URL:"),
-               '$audurl'    => L10n::t("Please enter an audio link/URL:"),
+               '$linkurl'   => L10n::t('Please enter a image/video/audio/webpage URL:'),
                '$term'      => L10n::t('Tag term:'),
                '$fileas'    => L10n::t('Save to Folder:'),
                '$whereareu' => L10n::t('Where are you right now?'),
@@ -1129,12 +1129,14 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$shortupload'  => L10n::t('upload photo'),
                '$attach'       => L10n::t('Attach file'),
                '$shortattach'  => L10n::t('attach file'),
-               '$weblink'      => L10n::t('Insert web link'),
-               '$shortweblink' => L10n::t('web link'),
-               '$video'        => L10n::t('Insert video link'),
-               '$shortvideo'   => L10n::t('video link'),
-               '$audio'        => L10n::t('Insert audio link'),
-               '$shortaudio'   => L10n::t('audio link'),
+               '$edbold'       => L10n::t('Bold'),
+               '$editalic'     => L10n::t('Italic'),
+               '$eduline'      => L10n::t('Underline'),
+               '$edquote'      => L10n::t('Quote'),
+               '$edcode'       => L10n::t('Code'),
+               '$edimg'        => L10n::t('Image'),
+               '$edurl'        => L10n::t('Link'),
+               '$edattach'     => L10n::t('Link or Media'),
                '$setloc'       => L10n::t('Set your location'),
                '$shortsetloc'  => L10n::t('set location'),
                '$noloc'        => L10n::t('Clear browser location'),