searchsubtrackingcommand.php 1008 B

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