peopletagnav.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * StatusNet, the distributed open-source microblogging tool
  4. *
  5. * Tabset for a particular list
  6. *
  7. * PHP version 5
  8. *
  9. * LICENCE: This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. * @category Action
  23. * @package StatusNet
  24. * @author Shashi Gowda <connect2shashi@gmail.com>
  25. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  26. * @link http://status.net/
  27. */
  28. if (!defined('STATUSNET') && !defined('LACONICA')) {
  29. exit(1);
  30. }
  31. require_once INSTALLDIR . '/lib/ui/widget.php';
  32. /**
  33. * Tabset for a group
  34. *
  35. * Shows a group of tabs for a particular user group
  36. *
  37. * @category Output
  38. * @package StatusNet
  39. * @author Shashi Gowda <connect2shashi@gmail.com>
  40. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  41. * @link http://status.net/
  42. *
  43. * @see HTMLOutputter
  44. */
  45. class PeopletagNav extends Menu
  46. {
  47. public $widgetOpts;
  48. public $scoped;
  49. var $group = null;
  50. /**
  51. * Construction
  52. *
  53. * @param Action $action current action, used for output
  54. */
  55. function __construct($action=null, $profile=null)
  56. {
  57. parent::__construct($action);
  58. $this->profile = $profile;
  59. }
  60. /**
  61. * Show the menu
  62. *
  63. * @return void
  64. */
  65. function show()
  66. {
  67. $action_name = $this->action->trimmed('action');
  68. $nickname = $this->profile->nickname;
  69. $this->out->elementStart('ul', array('class' => 'nav'));
  70. if (Event::handle('StartPeopletagGroupNav', array($this))) {
  71. $this->out->menuItem(common_local_url('peopletagsubscriptions', array('nickname' =>
  72. $nickname)),
  73. // TRANS: Menu item in the group navigation page.
  74. _m('MENU','List Subscriptions'),
  75. // TRANS: Tooltip for menu item in the group navigation page.
  76. // TRANS: %s is a user nickname.
  77. sprintf(_m('TOOLTIP','Lists subscribed to by %s.'), $nickname),
  78. $action_name == 'peopletagsubscriptions',
  79. 'nav_list_group');
  80. $this->out->menuItem(common_local_url('peopletagsforuser', array('nickname' =>
  81. $nickname)),
  82. // TRANS: Menu item in the group navigation page.
  83. // TRANS: %s is a user nickname.
  84. sprintf(_m('MENU','Lists with %s'), $nickname),
  85. // TRANS: Tooltip for menu item in the group navigation page.
  86. // TRANS: %s is a user nickname.
  87. sprintf(_m('TOOLTIP','Lists with %s.'), $nickname),
  88. $action_name == 'peopletagsforuser',
  89. 'nav_lists_with');
  90. $this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
  91. $nickname)),
  92. // TRANS: Menu item in the group navigation page.
  93. // TRANS: %s is a user nickname.
  94. sprintf(_m('MENU','Lists by %s'), $nickname),
  95. // TRANS: Tooltip for menu item in the group navigation page.
  96. // TRANS: %s is a user nickname.
  97. sprintf(_m('TOOLTIP','Lists by %s.'), $nickname),
  98. $action_name == 'peopletagsbyuser',
  99. 'nav_lists_by');
  100. Event::handle('EndPeopletagGroupNav', array($this));
  101. }
  102. $this->out->elementEnd('ul');
  103. }
  104. }