From 8205c56e25da078e84a8e1cb0a27755339ce43b2 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 17 Sep 2013 20:41:54 +0200 Subject: [PATCH] Stylesheet event now removed of StatusNet-remnants --- EVENTS.txt | 10 ++-------- lib/action.php | 10 +++------- lib/uapplugin.php | 4 ++-- plugins/Directory/DirectoryPlugin.php | 2 +- plugins/MobileProfile/MobileProfilePlugin.php | 7 +++---- plugins/ModPlus/ModPlusPlugin.php | 2 +- plugins/OStatus/OStatusPlugin.php | 2 +- plugins/Realtime/RealtimePlugin.php | 4 ++-- plugins/ShareNotice/ShareNoticePlugin.php | 2 +- 9 files changed, 16 insertions(+), 27 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index f97617bdb0..1d5b610b27 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -20,16 +20,10 @@ StartShowStyles: Showing Style links; good place to add UA style resets EndShowStyles: End showing Style links; good place to add custom styles - $action: the current action -StartShowStatusNetStyles: Showing StatusNet Style links +StartShowStylesheets: Showing stylesheet links - $action: the current action -EndShowStatusNetStyles: End showing StatusNet Style links; good place to add handheld or JavaScript dependant styles -- $action: the current action - -StartShowLaconicaStyles: backwards compatibility; deprecated -- $action: the current action - -EndShowLaconicaStyles: backwards compatibility; deprecated +EndShowStylesheets: End showing stylesheet links; good place to add handheld or JavaScript dependant styles - $action: the current action StartShowUAStyles: Showing custom User-Agent style links diff --git a/lib/action.php b/lib/action.php index 4a76dff9e2..72a83fed28 100644 --- a/lib/action.php +++ b/lib/action.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } require_once INSTALLDIR.'/lib/noticeform.php'; require_once INSTALLDIR.'/lib/htmloutputter.php'; @@ -283,11 +281,9 @@ class Action extends HTMLOutputter // lawsuit // Use old name for StatusNet for compatibility on events - if (Event::handle('StartShowStatusNetStyles', array($this)) && - Event::handle('StartShowLaconicaStyles', array($this))) { + if (Event::handle('StartShowStylesheets', array($this))) { $this->primaryCssLink(null, 'screen, projection, tv, print'); - Event::handle('EndShowStatusNetStyles', array($this)); - Event::handle('EndShowLaconicaStyles', array($this)); + Event::handle('EndShowStylesheets', array($this)); } $this->cssLink(common_path('js/extlib/jquery-ui/css/smoothness/jquery-ui.css', StatusNet::isHTTPS())); diff --git a/lib/uapplugin.php b/lib/uapplugin.php index 26d6a72d89..9a6aeab662 100644 --- a/lib/uapplugin.php +++ b/lib/uapplugin.php @@ -28,7 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -65,7 +65,7 @@ abstract class UAPPlugin extends Plugin * * @return boolean hook flag */ - function onEndShowStatusNetStyles($action) + public function onEndShowStylesheets(Action $action) { // XXX: allow override by theme $action->cssLink('css/uap.css', 'base', 'screen, projection, tv'); diff --git a/plugins/Directory/DirectoryPlugin.php b/plugins/Directory/DirectoryPlugin.php index 511b7eb561..a3cc01c935 100644 --- a/plugins/Directory/DirectoryPlugin.php +++ b/plugins/Directory/DirectoryPlugin.php @@ -153,7 +153,7 @@ class DirectoryPlugin extends Plugin * * @return boolean hook flag */ - function onEndShowStatusNetStyles($action) + public function onEndShowStylesheets(Action $action) { if (in_array( $action->trimmed('action'), diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 76d285ba27..0eb57035d1 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -244,7 +244,7 @@ class MobileProfilePlugin extends WAP20Plugin } } - function onStartShowStatusNetStyles($action) + public function onStartShowStylesheets(Action $action) { if (!$this->serveMobile) { return true; @@ -263,8 +263,7 @@ class MobileProfilePlugin extends WAP20Plugin } // Allow other plugins to load their styles. - Event::handle('EndShowStatusNetStyles', array($action)); - Event::handle('EndShowLaconicaStyles', array($action)); + Event::handle('EndShowStylesheets', array($action)); return false; } diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php index d66ec6054a..8d43f53b9a 100644 --- a/plugins/ModPlus/ModPlusPlugin.php +++ b/plugins/ModPlus/ModPlusPlugin.php @@ -57,7 +57,7 @@ class ModPlusPlugin extends Plugin return true; } - function onEndShowStatusNetStyles($action) { + public function onEndShowStylesheets(Action $action) { $action->cssLink($this->path('modplus.css')); return true; } diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index d34535bdcb..82e059c0fa 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -518,7 +518,7 @@ class OStatusPlugin extends Plugin return true; } - function onEndShowStatusNetStyles($action) { + public function onEndShowStylesheets(Action $action) { $action->cssLink($this->path('theme/base/css/ostatus.css')); return true; } diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 42a254ab0c..958716fa76 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -140,7 +140,7 @@ class RealtimePlugin extends Plugin return true; } - function onEndShowStatusNetStyles($action) + public function onEndShowStylesheets(Action $action) { $action->cssLink(Plugin::staticPath('Realtime', 'realtimeupdate.css'), null, diff --git a/plugins/ShareNotice/ShareNoticePlugin.php b/plugins/ShareNotice/ShareNoticePlugin.php index 08362f7932..86ecfa8837 100644 --- a/plugins/ShareNotice/ShareNoticePlugin.php +++ b/plugins/ShareNotice/ShareNoticePlugin.php @@ -32,7 +32,7 @@ class ShareNoticePlugin extends Plugin array('StatusNet', array('baseurl' => 'http://identi.ca')) ); - function onEndShowStatusNetStyles($action) { + public function onEndShowStylesheets(Action $action) { $action->cssLink($this->path('css/sharenotice.css')); return true; }