123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- defined('GNUSOCIAL') || die();
- class OverwriteThemeBackgroundPlugin extends Plugin
- {
- const PLUGIN_VERSION = '0.1.1';
-
- public function onRouterInitialized(URLMapper $m): bool
- {
- $m->connect('plugins/OverwriteThemeBackground/css/my_custom_theme_bg',
- ['action' => 'OverwriteThemeBackgroundCSS']);
- $m->connect('panel/overwritethemebackground',
- ['action' => 'overwritethemebackgroundAdminPanel']);
- return true;
- }
-
- public function onPluginVersion(array &$versions): bool
- {
- $versions[] = [
- 'name' => 'Overwrite Theme Background',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Diogo Cordeiro',
- 'homepage' => 'https://www.diogo.site/projects/GNU-social/plugins/OverwriteThemeBackgroundPlugin',
-
- 'rawdescription' => _m('A friendly plugin for overwriting your theme\'s background style.')
- ];
- return true;
- }
-
- public function onEndShowStyles(Action $action): bool
- {
- $action->cssLink(common_local_url('OverwriteThemeBackgroundCSS'));
- return true;
- }
-
- public function onEndAdminPanelNav(AdminPanelNav $nav): bool
- {
- if (AdminPanelAction::canAdmin('profilefields')) {
- $action_name = $nav->action->trimmed('action');
- $nav->out->menuItem(
- common_local_url('overwritethemebackgroundAdminPanel'),
- _m('Overwrite Theme Background'),
- _m('Customize your theme\'s background easily'),
- $action_name == 'overwritethemebackgroundAdminPanel',
- 'nav_overwritethemebackground_admin_panel'
- );
- }
- return true;
- }
- }
|