peopletagnav.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. var $group = null;
  48. /**
  49. * Construction
  50. *
  51. * @param Action $action current action, used for output
  52. */
  53. function __construct($action=null, $profile=null)
  54. {
  55. parent::__construct($action);
  56. $this->profile = $profile;
  57. }
  58. /**
  59. * Show the menu
  60. *
  61. * @return void
  62. */
  63. function show()
  64. {
  65. $action_name = $this->action->trimmed('action');
  66. $nickname = $this->profile->nickname;
  67. $this->out->elementStart('ul', array('class' => 'nav'));
  68. if (Event::handle('StartPeopletagGroupNav', array($this))) {
  69. $this->out->menuItem(common_local_url('peopletagsubscriptions', array('nickname' =>
  70. $nickname)),
  71. // TRANS: Menu item in the group navigation page.
  72. _m('MENU','List Subscriptions'),
  73. // TRANS: Tooltip for menu item in the group navigation page.
  74. // TRANS: %s is a user nickname.
  75. sprintf(_m('TOOLTIP','Lists subscribed to by %s.'), $nickname),
  76. $action_name == 'peopletagsubscriptions',
  77. 'nav_list_group');
  78. $this->out->menuItem(common_local_url('peopletagsforuser', array('nickname' =>
  79. $nickname)),
  80. // TRANS: Menu item in the group navigation page.
  81. // TRANS: %s is a user nickname.
  82. sprintf(_m('MENU','Lists with %s'), $nickname),
  83. // TRANS: Tooltip for menu item in the group navigation page.
  84. // TRANS: %s is a user nickname.
  85. sprintf(_m('TOOLTIP','Lists with %s.'), $nickname),
  86. $action_name == 'peopletagsforuser',
  87. 'nav_lists_with');
  88. $this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
  89. $nickname)),
  90. // TRANS: Menu item in the group navigation page.
  91. // TRANS: %s is a user nickname.
  92. sprintf(_m('MENU','Lists by %s'), $nickname),
  93. // TRANS: Tooltip for menu item in the group navigation page.
  94. // TRANS: %s is a user nickname.
  95. sprintf(_m('TOOLTIP','Lists by %s.'), $nickname),
  96. $action_name == 'peopletagsbyuser',
  97. 'nav_lists_by');
  98. Event::handle('EndPeopletagGroupNav', array($this));
  99. }
  100. $this->out->elementEnd('ul');
  101. }
  102. }