1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- if (!defined('STATUSNET')) { exit(1); }
- class GroupFavoritedPlugin extends Plugin
- {
-
- function onRouterInitialized(URLMapper $m)
- {
- $m->connect('group/:nickname/favorited',
- array('action' => 'groupfavorited'),
- array('nickname' => '[a-zA-Z0-9]+'));
- return true;
- }
- function onEndGroupGroupNav(Menu $nav)
- {
- $action_name = $nav->action->trimmed('action');
- $nickname = $nav->group->nickname;
- $nav->out->menuItem(common_local_url('groupfavorited', array('nickname' =>
- $nickname)),
-
- _m('MENU', 'Popular'),
-
-
- sprintf(_m('TOOLTIP','Popular notices in %s group'), $nickname),
- $action_name == 'groupfavorited',
- 'nav_group_group');
- }
-
- function onPluginVersion(array &$versions)
- {
- $url = 'http://status.net/wiki/Plugin:GroupFavorited';
- $versions[] = array('name' => 'GroupFavorited',
- 'version' => GNUSOCIAL_VERSION,
- 'author' => 'Brion Vibber',
- 'homepage' => $url,
- 'rawdescription' =>
-
- _m('This plugin adds a menu item for popular notices in groups.'));
- return true;
- }
- }
|