]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Correctly initialize post actions button template variable
[friendica.git] / include / conversation.php
index 264fa6ceb4d56603edb4168a1abeb17d6374e313..7d0ec0b724566c72d003aa392946a605956c5c70 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 /**
- * @file include/conversation.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
@@ -494,7 +510,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                }
        } elseif ($mode === 'profile') {
                $items = conversation_add_children($items, false, $order, $uid);
-               $profile_owner = $a->profile['profile_uid'];
+               $profile_owner = $a->profile['uid'];
 
                if (!$update) {
                        $tab = 'posts';
@@ -508,7 +524,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                 */
 
                                $live_update_div = '<div id="live-profile"></div>' . "\r\n"
-                                       . "<script> var profile_uid = " . $a->profile['profile_uid']
+                                       . "<script> var profile_uid = " . $a->profile['uid']
                                        . "; var netargs = '?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
                        }
                }
@@ -657,7 +673,11 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                $isstarred = "unstarred";
 
                                $lock = false;
-                               $likebuttons = false;
+                               $likebuttons = [
+                                       'like'    => null,
+                                       'dislike' => null,
+                                       'share'   => null,
+                               ];
 
                                $body = Item::prepareBody($item, true, $preview);
 
@@ -791,7 +811,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
 /**
  * Fetch all comments from a query. Additionally set the newest resharer as thread owner.
  *
- * @param array   $thread_items Database statement with thread posts
+ * @param mixed   $thread_items Database statement with thread posts
  * @param boolean $pinned       Is the item pinned?
  *
  * @return array items with parents and comments
@@ -919,9 +939,9 @@ function item_photo_menu($item) {
        }
 
        if ($sparkle) {
-               $status_link = $profile_link . '?tab=status';
+               $status_link = $profile_link . '/status';
                $photos_link = str_replace('/profile/', '/photos/', $profile_link);
-               $profile_link = $profile_link . '?=profile';
+               $profile_link = $profile_link . '/profile';
        }
 
        if (!empty($pcid)) {
@@ -1214,6 +1234,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$return_path'  => $query_str,
                '$action'       => 'item',
                '$share'        => ($x['button'] ?? '') ?: DI::l10n()->t('Share'),
+               '$loading'      => DI::l10n()->t('Loading...'),
                '$upload'       => DI::l10n()->t('Upload photo'),
                '$shortupload'  => DI::l10n()->t('upload photo'),
                '$attach'       => DI::l10n()->t('Attach file'),