3 * GNU Social - a federating social network
4 * Copyright (C) 2014, Free Software Foundation, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if (!defined('GNUSOCIAL')) { exit(1); }
23 * Placeholder for showing faves...
25 class ThreadedNoticeListFavesItem extends NoticeListActorsItem
27 function getProfiles()
29 $faves = Fave::byNotice($this->notice);
31 foreach ($faves as $fave) {
32 $profiles[] = $fave->user_id;
37 function magicList($items)
39 if (count($items) > 4) {
40 return parent::magicList(array_slice($items, 0, 3));
42 return parent::magicList($items);
46 function getListMessage($count, $you)
48 if ($count == 1 && $you) {
49 // darn first person being different from third person!
50 // TRANS: List message for notice favoured by logged in user.
51 return _m('FAVELIST', 'You like this.');
52 } else if ($count > 4) {
53 // TRANS: List message for when more than 4 people like something.
54 // TRANS: %%s is a list of users liking a notice, %d is the number over 4 that like the notice.
55 // TRANS: Plural is decided on the total number of users liking the notice (count of %%s + %d).
56 return sprintf(_m('%%s and %d others like this.',
57 '%%s and %d others like this.',
61 // TRANS: List message for favoured notices.
62 // TRANS: %%s is a list of users liking a notice.
63 // TRANS: Plural is based on the number of of users that have favoured a notice.
64 return sprintf(_m('%%s likes this.',
73 $this->out->elementStart('li', array('class' => 'notice-data notice-faves'));
78 $this->out->elementEnd('li');