123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class ModPlusPlugin extends Plugin
- {
- const PLUGIN_VERSION = '2.0.0';
- public function onPluginVersion(array &$versions): bool
- {
- $versions[] = array('name' => 'ModPlus',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Brion Vibber',
- 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ModPlus',
- 'rawdescription' =>
-
- _m('UI extension for profile moderation actions.'));
- return true;
- }
-
- function onEndShowScripts(Action $action)
- {
- $action->script($this->path('js/modplus.js'));
- return true;
- }
- public function onEndShowStylesheets(Action $action) {
- $action->cssLink($this->path('css/modplus.css'));
- return true;
- }
-
- function onEndShowNoticeItemAuthor(Profile $profile, HTMLOutputter $out)
- {
- $this->showProfileOptions($out, $profile);
- return true;
- }
-
- function onStartProfileListItemProfile($item)
- {
- $this->showProfileOptions($item->out, $item->profile->getProfile());
- return true;
- }
-
- protected function showProfileOptions(HTMLOutputter $out, Profile $profile)
- {
- if (!$profile->isGroup() && !$profile->isLocal()) {
- $target = common_local_url('userbyid', array('id' => $profile->getID()));
-
- $label = _m('Remote profile options...');
- $out->elementStart('div', 'remote-profile-options');
- $out->element('a', array('href' => $target), $label);
- $out->elementEnd('div');
- }
- }
- }
|