]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/SearchSub/searchsubtrackingcommand.php
Localisation updates from http://translatewiki.net.
[quix0rs-gnu-social.git] / plugins / SearchSub / searchsubtrackingcommand.php
1 <?php
2
3 class SearchSubTrackingCommand extends Command
4 {
5     function handle($channel)
6     {
7         $cur = $this->user;
8         $all = new SearchSub();
9         $all->profile_id = $cur->id;
10         $all->find();
11
12         if ($all->N == 0) {
13             // TRANS: Error text shown a user tries to disable all a search subscriptions with track off command, but has none.
14             $channel->error($cur, _m('You are not tracking any searches.'));
15             return;
16         }
17
18         $list = array();
19         while ($all->fetch()) {
20             $list[] = $all->search;
21         }
22
23         // TRANS: Separator for list of tracked searches.
24         $separator = _m('SEPARATOR','", "');
25
26         // TRANS: Message given having disabled all search subscriptions with 'track off'.
27         // TRANS: %s is a list of searches. Separator default is '", "'.
28         $channel->output($cur, sprintf(_m('You are tracking searches for: "%s".'),
29                                        implode($separator, $list)));
30     }
31 }