X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=e713994bc6f6b1d8eab5042357bf8932a5c906ec;hb=da124af6edfd788877307decc187fe7f0ff2b4c7;hp=d09c918d1501019972d2292dfbae851c2c1d790b;hpb=5dfee31108fc92a7abca5f99b8fdf1b34aec5dd5;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index d09c918d15..e713994bc6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1,6 +1,22 @@ . + * */ use Friendica\App; @@ -8,9 +24,7 @@ use Friendica\Content\ContactSelector; use Friendica\Content\Feature; use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; -use Friendica\Core\Config; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; @@ -446,7 +460,6 @@ function conv_get_blocklist() * that are based on unique features of the calling module. * @param App $a * @param array $items - * @param Pager $pager * @param $mode * @param $update * @param bool $preview @@ -456,7 +469,7 @@ function conv_get_blocklist() * @throws ImagickException * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ -function conversation(App $a, array $items, Pager $pager, $mode, $update, $preview = false, $order = 'commented', $uid = 0) +function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { $ssl_state = (local_user() ? true : false); @@ -492,11 +505,11 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ . (!empty($_GET['cmax']) ? '&cmax=' . rawurlencode($_GET['cmax']) : '') . (!empty($_GET['file']) ? '&file=' . rawurlencode($_GET['file']) : '') - . "'; var profile_page = " . $pager->getPage() . "; \r\n"; + . "'; \r\n"; } } 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'; @@ -510,8 +523,8 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ */ $live_update_div = '
' . "\r\n" - . "\r\n"; + . "\r\n"; } } } elseif ($mode === 'notes') { @@ -521,7 +534,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + . "; var netargs = '/?f='; \r\n"; } } elseif ($mode === 'display') { $items = conversation_add_children($items, false, $order, $uid); @@ -530,7 +543,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ if (!$update) { $live_update_div = '
' . "\r\n" . ""; + . ""; } } elseif ($mode === 'community') { $items = conversation_add_children($items, true, $order, $uid); @@ -539,7 +552,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + ."/?f='; \r\n"; } } elseif ($mode === 'contacts') { $items = conversation_add_children($items, false, $order, $uid); @@ -548,7 +561,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + ."/?f='; \r\n"; } } elseif ($mode === 'search') { $live_update_div = '' . "\r\n"; @@ -659,7 +672,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); @@ -793,7 +810,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 @@ -851,7 +868,7 @@ function conversation_fetch_comments($thread_items, $pinned) { * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ function conversation_add_children(array $parents, $block_authors, $order, $uid) { - $max_comments = Config::get('system', 'max_comments', 100); + $max_comments = DI::config()->get('system', 'max_comments', 100); $params = ['order' => ['uid', 'commented' => true]]; @@ -921,9 +938,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)) { @@ -1216,6 +1233,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'), @@ -1581,19 +1599,19 @@ function get_response_button_text($v, $count) $return = ''; switch ($v) { case 'like': - $return = L10n::tt('Like', 'Likes', $count); + $return = DI::l10n()->tt('Like', 'Likes', $count); break; case 'dislike': - $return = L10n::tt('Dislike', 'Dislikes', $count); + $return = DI::l10n()->tt('Dislike', 'Dislikes', $count); break; case 'attendyes': - $return = L10n::tt('Attending', 'Attending', $count); + $return = DI::l10n()->tt('Attending', 'Attending', $count); break; case 'attendno': - $return = L10n::tt('Not Attending', 'Not Attending', $count); + $return = DI::l10n()->tt('Not Attending', 'Not Attending', $count); break; case 'attendmaybe': - $return = L10n::tt('Undecided', 'Undecided', $count); + $return = DI::l10n()->tt('Undecided', 'Undecided', $count); break; }