]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/threadednoticelistmoreitem.php
[MEDIA] ImageFile now extends MediaFile and validates images more aggressively.
[quix0rs-gnu-social.git] / lib / threadednoticelistmoreitem.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 /**
6  * Placeholder for loading more replies...
7  */
8 class ThreadedNoticeListMoreItem extends NoticeListItem
9 {
10     protected $cnt;
11
12     function __construct(Notice $notice, Action $out, $cnt)
13     {
14         parent::__construct($notice, $out);
15         $this->cnt = $cnt;
16     }
17
18     /**
19      * recipe function for displaying a single notice.
20      *
21      * This uses all the other methods to correctly display a notice. Override
22      * it or one of the others to fine-tune the output.
23      *
24      * @return void
25      */
26     function show()
27     {
28         $this->showStart();
29         $this->showMiniForm();
30         $this->showEnd();
31     }
32
33     /**
34      * start a single notice.
35      *
36      * @return void
37      */
38     function showStart()
39     {
40         $this->out->elementStart('li', array('class' => 'notice-reply-comments'));
41     }
42
43     function showEnd()
44     {
45         $this->out->elementEnd('li');
46     }
47
48     function showMiniForm()
49     {
50         $id = $this->notice->conversation;
51         $url = common_local_url('conversation', array('id' => $id));
52
53         $n = Conversation::noticeCount($id) - 1;
54
55         // TRANS: Link to show replies for a notice.
56         // TRANS: %d is the number of replies to a notice and used for plural.
57         $msg = sprintf(_m('Show reply', 'Show all %d replies', $n), $n);
58
59         $this->out->element('a', array('href' => $url), $msg);
60     }
61 }