]> git.mxchange.org Git - friendica.git/commitdiff
allow hidden comments phrase to be accessed separately as number and text
authorZach Prezkuta <fermion@gmx.com>
Thu, 20 Sep 2012 03:31:26 +0000 (21:31 -0600)
committerZach Prezkuta <fermion@gmx.com>
Thu, 20 Sep 2012 03:31:26 +0000 (21:31 -0600)
include/conversation.php
mod/content.php
object/Item.php

index 1d927d2016b568213b17bd63859ffd68e35c5492..cf5b0fe08899314fd9f6f550395e2e41d1ba788b 100644 (file)
@@ -685,6 +685,8 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
                $item_result = $arr['output'];
                if($firstcollapsed) {
                        $item_result['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
+                       $item_result['hidden_comments_num'] = $total_children;
+                       $item_result['hidden_comments_text'] = tt('comment', 'comments', $total_children);
                        $item_result['hide_text'] = t('show more');
                }
 
index e6789860db0ed6c60e343977d9004e0dbcfa456d..d827b5b57b4cf79ff08a6cf1434685701d15b454 100644 (file)
@@ -584,6 +584,8 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                        if (!$comments_collapsed){
                                                $threads[$threadsid]['num_comments'] = sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),$comments[$item['parent']] );
+                                               $threads[$threadsid]['hidden_comments_num'] = $comments[$item['parent']];
+                                               $threads[$threadsid]['hidden_comments_text'] = tt('comment', 'comments', $comments[$item['parent']]);
                                                $threads[$threadsid]['hide_text'] = t('show more');
                                                $comments_collapsed = true;
                                                $comment_firstcollapsed = true;
index 7fa3fed2d3ab77b57a5555115da258670179b9a1..d40a384f56b1c0ff502d1118a586aa342e0dae2b 100644 (file)
@@ -254,6 +254,8 @@ class Item extends BaseObject {
                        if(($nb_children > 2) || ($thread_level > 1)) {
                                $result['children'][0]['comment_firstcollapsed'] = true;
                                $result['children'][0]['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
+                               $result['children'][0]['hidden_comments_num'] = $total_children;
+                               $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children);
                                $result['children'][0]['hide_text'] = t('show more');
                                if($thread_level > 1) {
                                        $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;