From f06e661a9bd2cde41c9974896bb5f819469dad14 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:36:25 -0500 Subject: [PATCH 01/22] new methods for paths to plugin static files --- README | 17 +++++++++++++++++ lib/default.php | 3 +++ lib/plugin.php | 43 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/README b/README index d972bf5676..b71d21aba5 100644 --- a/README +++ b/README @@ -1572,6 +1572,23 @@ proxy_user: Username to use for authenticating to the HTTP proxy. Default null. proxy_password: Password to use for authenticating to the HTTP proxy. Default null. proxy_auth_scheme: Scheme to use for authenticating to the HTTP proxy. Default null. +plugins +------- + +default: associative array mapping plugin name to array of arguments. To disable + a default plugin, unset its value in this array. +locale_path: path for finding plugin locale files. In the plugin's directory + by default. +server: Server to find static files for a plugin when the page is plain old HTTP. + Defaults to site/server (same as pages). Use this to move plugin CSS and + JS files to a CDN. +sslserver: Server to find static files for a plugin when the page is HTTPS. Defaults + to site/server (same as pages). Use this to move plugin CSS and JS files + to a CDN. +path: Path to the plugin files. defaults to site/path + '/plugins/'. Expects that + each plugin will have a subdirectory at plugins/NameOfPlugin. Change this + if you're using a CDN. + Plugins ======= diff --git a/lib/default.php b/lib/default.php index 2ddc47bd17..7d8b1fec7a 100644 --- a/lib/default.php +++ b/lib/default.php @@ -314,6 +314,9 @@ $default = 'RSSCloud' => null, 'OpenID' => null), 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories + 'server' => null, + 'sslserver' => null, + 'path' => null, ), 'admin' => array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license')), diff --git a/lib/plugin.php b/lib/plugin.php index 3f84afa27e..1ca5deb5c5 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -110,11 +110,16 @@ class Plugin { $this->log(LOG_DEBUG, $msg); } + + function name() + { + $cls = get_class($this); + return mb_substr($cls, 0, -6); + } function onPluginVersion(&$versions) { - $cls = get_class($this); - $name = mb_substr($cls, 0, -6); + $name = $this->name(); $versions[] = array('name' => $name, // TRANS: Displayed as version information for a plugin if no version information was found. @@ -122,4 +127,38 @@ class Plugin return true; } + + function path($relative) + { + return self::staticPath($this->name(), $relative); + } + + static function staticPath($plugin, $relative) + { + $isHTTPS = StatusNet::isHTTPS(); + + if ($isHTTPS) { + $server = common_config('plugins', 'sslserver'); + } else { + $server = common_config('plugins', 'server'); + } + + if (is_null($server)) { + if ($isHTTPS) { + $server = common_config('site', 'sslserver'); + } else { + $server = common_config('site', 'server'); + } + } + + $path = common_config('plugins', 'path'); + + if (is_null($path)) { + $path = common_config('site', 'path') . '/plugins/'; + } + + $protocol = ($isHTTPS) ? 'https' : 'http'; + + return $protocol.'://'.$server.$path.$plugin.'/'.$relative; + } } From 52c3c4468d6088d5328b0014b65df9ec8ca1ce46 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:46:56 -0500 Subject: [PATCH 02/22] BlankAd uses plugins server --- plugins/BlankAd/BlankAdPlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/BlankAd/BlankAdPlugin.php b/plugins/BlankAd/BlankAdPlugin.php index 49243aeea9..9128e7bcdb 100644 --- a/plugins/BlankAd/BlankAdPlugin.php +++ b/plugins/BlankAd/BlankAdPlugin.php @@ -65,7 +65,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 300, 'height' => 250, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -81,7 +81,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 180, 'height' => 150, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -97,7 +97,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 160, 'height' => 600, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -113,7 +113,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 728, 'height' => 90, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } From 429cbb66b4f1d1b8ffd0bed6a75fcd6e2ce2d553 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:50:11 -0500 Subject: [PATCH 03/22] Mapstraction plugin uses Plugin::path() --- plugins/Mapstraction/MapstractionPlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index 020c0818ad..13c5e22057 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -129,7 +129,7 @@ class MapstractionPlugin extends Plugin break; case 'openlayers': // Use our included stripped & minified OpenLayers. - $action->script(common_path('plugins/Mapstraction/OpenLayers/OpenLayers.js')); + $action->script($this->path('OpenLayers/OpenLayers.js')); break; case 'yahoo': $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', @@ -145,13 +145,13 @@ class MapstractionPlugin extends Plugin // // Note that OpenLayers.js needs to be separate, or it won't // be able to find its UI images and styles. - $action->script(common_path('plugins/Mapstraction/usermap-mxn-openlayers.min.js')); + $action->script($this->path('usermap-mxn-openlayers.min.js')); } else { $action->script(sprintf('%s?(%s)', - common_path('plugins/Mapstraction/js/mxn.js'), + $this->path('js/mxn.js'), $this->provider)); - $action->script(common_path('plugins/Mapstraction/usermap.js')); + $action->script($this->path('usermap.js')); } $action->inlineScript(sprintf('var _provider = "%s";', $this->provider)); From 0a6d2d24b13436933bbda75290d9c5108c1fb367 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:51:59 -0500 Subject: [PATCH 04/22] MeteorPlugin uses Plugin::path() --- plugins/Meteor/MeteorPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Meteor/MeteorPlugin.php b/plugins/Meteor/MeteorPlugin.php index 1bdccae7a8..6e93e364f7 100644 --- a/plugins/Meteor/MeteorPlugin.php +++ b/plugins/Meteor/MeteorPlugin.php @@ -89,7 +89,7 @@ class MeteorPlugin extends RealtimePlugin { $scripts = parent::_getScripts(); $scripts[] = 'http://'.$this->webserver.(($this->webport == 80) ? '':':'.$this->webport).'/meteor.js'; - $scripts[] = common_path('plugins/Meteor/meteorupdater.min.js'); + $scripts[] = $this->path('meteorupdater.min.js'); return $scripts; } From 26407c3e35a328879816f56f3b722b1b1c3b5d8a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:58:06 -0500 Subject: [PATCH 05/22] Realtime plugin uses Plugin::path() --- plugins/Realtime/RealtimePlugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 113187e1e3..5d119982f5 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -116,8 +116,9 @@ class RealtimePlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/Realtime/realtimeupdate.css', - null, 'screen, projection, tv'); + $action->cssLink($this->path('realtimeupdate.css'), + null, + 'screen, projection, tv'); return true; } @@ -322,7 +323,7 @@ class RealtimePlugin extends Plugin function _getScripts() { - return array('plugins/Realtime/realtimeupdate.min.js'); + return array($this->path('realtimeupdate.min.js')); } /** From c8386c7ecb9f77f1a4eb606b6ae0c43c9337a86a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:03:24 -0500 Subject: [PATCH 06/22] TwitterBridge uses Plugin::staticPath() --- plugins/TwitterBridge/twitterlogin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TwitterBridge/twitterlogin.php b/plugins/TwitterBridge/twitterlogin.php index 5b5bfae191..062c781f77 100644 --- a/plugins/TwitterBridge/twitterlogin.php +++ b/plugins/TwitterBridge/twitterlogin.php @@ -83,7 +83,7 @@ class TwitterloginAction extends Action $this->elementStart('a', array('href' => common_local_url('twitterauthorization', null, array('signin' => true)))); - $this->element('img', array('src' => common_path('plugins/TwitterBridge/Sign-in-with-Twitter-lighter.png'), + $this->element('img', array('src' => Plugin::staticPath('TwitterBridge', 'Sign-in-with-Twitter-lighter.png'), 'alt' => _m('Sign in with Twitter'))); $this->elementEnd('a'); } From 22e8893fbaccc31294e3916e141d0d83fc54df90 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:09:26 -0500 Subject: [PATCH 07/22] OStatus uses Plugin::path() --- plugins/OStatus/OStatusPlugin.php | 4 ++-- plugins/OStatus/classes/Ostatus_profile.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 59c18746f0..8e6e2d2891 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -419,12 +419,12 @@ class OStatusPlugin extends Plugin } function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css'); + $action->cssLink($this->path('theme/base/css/ostatus.css')); return true; } function onEndShowStatusNetScripts($action) { - $action->script('plugins/OStatus/js/ostatus.js'); + $action->script($this->path('js/ostatus.js')); return true; } diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 303e177a57..13711d39f4 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -1112,7 +1112,8 @@ class Ostatus_profile extends Memcached_DataObject return $url; } } - return common_path('plugins/OStatus/images/96px-Feed-icon.svg.png'); + + return Plugin::staticPath('OStatus', 'images/96px-Feed-icon.svg.png'); } /** From 0bab5e4a9ef114c89b2b12d105d4d68f80f101cd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:16:30 -0500 Subject: [PATCH 08/22] Autocomplete uses Plugin::path() --- plugins/Autocomplete/AutocompletePlugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index 230ba089de..ca495f79f4 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -51,15 +51,15 @@ class AutocompletePlugin extends Plugin function onEndShowScripts($action){ if (common_logged_in()) { - $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); - $action->script('plugins/Autocomplete/Autocomplete.js'); + $action->script($this->path('jquery-autocomplete/jquery.autocomplete.pack.js')); + $action->script($this->path('Autocomplete.js')); } } function onEndShowStatusNetStyles($action) { if (common_logged_in()) { - $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css'); + $action->cssLink($this->path('jquery-autocomplete/jquery.autocomplete.css')); } } From 6494f5938cfe74ae539e15d14d9ae6ba46ab20a5 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:19:03 -0500 Subject: [PATCH 09/22] ClientSideShorten uses Plugin::path() --- plugins/ClientSideShorten/ClientSideShortenPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index 27a3a56f72..443d2fffe0 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -53,7 +53,7 @@ class ClientSideShortenPlugin extends Plugin function onEndShowScripts($action){ $action->inlineScript('var Notice_maxContent = ' . Notice::maxContent()); if (common_logged_in()) { - $action->script('plugins/ClientSideShorten/shorten.js'); + $action->script($this->path('shorten.js')); } } From 0ba450373d3ca788fa4baf7d85e266c4dc77f2ca Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:20:57 -0500 Subject: [PATCH 10/22] DirectionDetector uses Plugin::path() --- plugins/DirectionDetector/DirectionDetectorPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 4a38f390f1..ec206dd75c 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -129,7 +129,7 @@ class DirectionDetectorPlugin extends Plugin { */ function onEndShowScripts($action){ if (common_logged_in()) { - $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js'); + $action->script($this->path('jquery.DirectionDetector.js')); } } From 3496559d8e29d73aa6ebf3c759ec81eca4c466b9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:23:39 -0500 Subject: [PATCH 11/22] InfiniteScroll uses Plugin::path() --- plugins/InfiniteScroll/InfiniteScrollPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php index 50c1b5a208..b6c4fabba0 100644 --- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -40,8 +40,8 @@ class InfiniteScrollPlugin extends Plugin function onEndShowScripts($action) { - $action->script('plugins/InfiniteScroll/jquery.infinitescroll.js'); - $action->script('plugins/InfiniteScroll/infinitescroll.js'); + $action->script($this->path('jquery.infinitescroll.js')); + $action->script($this->path('infinitescroll.js')); } function onPluginVersion(&$versions) From 2f598f8c7be264bcb945c7fb04a4dd0be95bafc8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:25:56 -0500 Subject: [PATCH 12/22] LinkPreview uses Plugin::path() --- plugins/LinkPreview/LinkPreviewPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php index 65f896ca27..8bc726413d 100644 --- a/plugins/LinkPreview/LinkPreviewPlugin.php +++ b/plugins/LinkPreview/LinkPreviewPlugin.php @@ -51,7 +51,7 @@ class LinkPreviewPlugin extends Plugin { $user = common_current_user(); if ($user && common_config('attachments', 'process_links')) { - $action->script('plugins/LinkPreview/linkpreview.min.js'); + $action->script($this->path('linkpreview.min.js')); $data = json_encode(array( 'api' => common_local_url('oembedproxy'), 'width' => common_config('attachments', 'thumbwidth'), From 50675e356b4e5b184de35c3bfdc1d5207f5a4da0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:28:39 -0500 Subject: [PATCH 13/22] ModPlus uses Plugin::path() --- plugins/ModPlus/ModPlusPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php index 3e7a8c7455..d2b7c09346 100644 --- a/plugins/ModPlus/ModPlusPlugin.php +++ b/plugins/ModPlus/ModPlusPlugin.php @@ -51,13 +51,13 @@ class ModPlusPlugin extends Plugin { $user = common_current_user(); if ($user) { - $action->script('plugins/ModPlus/modplus.js'); + $action->script($this->path('modplus.js')); } return true; } function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/ModPlus/modplus.css'); + $action->cssLink($this->path('modplus.css')); return true; } From 21950205668c913e905a1e458af8062ab37c6730 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:30:14 -0500 Subject: [PATCH 14/22] TabFocus uses Plugin::path() --- plugins/TabFocus/TabFocusPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php index dd8a972767..1b1d1c2b0a 100644 --- a/plugins/TabFocus/TabFocusPlugin.php +++ b/plugins/TabFocus/TabFocusPlugin.php @@ -41,7 +41,7 @@ class TabFocusPlugin extends Plugin function onEndShowScripts($action) { - $action->script('plugins/TabFocus/tabfocus.js'); + $action->script($this->path('tabfocus.js')); } function onPluginVersion(&$versions) From 27eeee08c1534859dc944346422597610ab2f7c7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:38:11 -0500 Subject: [PATCH 15/22] FIXME for Plugin::path() in TinyMCE --- plugins/TinyMCE/TinyMCEPlugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/TinyMCE/TinyMCEPlugin.php b/plugins/TinyMCE/TinyMCEPlugin.php index e0640ebdf3..49bbdf90db 100644 --- a/plugins/TinyMCE/TinyMCEPlugin.php +++ b/plugins/TinyMCE/TinyMCEPlugin.php @@ -38,6 +38,10 @@ if (!defined('STATUSNET')) { * Use TinyMCE library to allow rich text editing in the browser * * Converts the notice form in browser to a rich-text editor. + * + * FIXME: this plugin DOES NOT load its static files from the configured + * plugin server if one exists. There are cross-server permissions errors + * if you try to do that (something about window.tinymce). * * @category WYSIWYG * @package StatusNet From 9ae3d3de36e069d215fbc11f29d6058d1759b65c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:41:47 -0500 Subject: [PATCH 16/22] NewMenu uses Plugin::path() --- plugins/NewMenu/NewMenuPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/NewMenu/NewMenuPlugin.php b/plugins/NewMenu/NewMenuPlugin.php index 7aad0672bf..2454f867d6 100644 --- a/plugins/NewMenu/NewMenuPlugin.php +++ b/plugins/NewMenu/NewMenuPlugin.php @@ -331,7 +331,7 @@ class NewMenuPlugin extends Plugin array('default', 'identica', 'h4ck3r'))) && ($action instanceof AccountSettingsAction || $action instanceof ConnectSettingsAction)) { - $action->cssLink(common_path('plugins/NewMenu/newmenu.css')); + $action->cssLink($this->path('newmenu.css')); } return true; } From 0c7104ec2fd3aeb9f0e1b8df2d2f853ade459085 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:46:20 -0500 Subject: [PATCH 17/22] MobileProfile uses Plugin::path() --- plugins/MobileProfile/MobileProfilePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index b50440682f..b9c25ab998 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -241,13 +241,13 @@ class MobileProfilePlugin extends WAP20Plugin if (file_exists(Theme::file('css/mp-screen.css'))) { $action->cssLink('css/mp-screen.css', null, 'screen'); } else { - $action->cssLink('plugins/MobileProfile/mp-screen.css',null,'screen'); + $action->cssLink($this->path('mp-screen.css'),null,'screen'); } if (file_exists(Theme::file('css/mp-handheld.css'))) { $action->cssLink('css/mp-handheld.css', null, 'handheld'); } else { - $action->cssLink('plugins/MobileProfile/mp-handheld.css',null,'handheld'); + $action->cssLink($this->path('mp-handheld.css'),null,'handheld'); } // Allow other plugins to load their styles. From 55af561887d1c2992af75994bef9615a42aec60e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:49:00 -0500 Subject: [PATCH 18/22] ShareNotice uses Plugin::path() --- plugins/ShareNotice/ShareNoticePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ShareNotice/ShareNoticePlugin.php b/plugins/ShareNotice/ShareNoticePlugin.php index 8b94f83c8f..0cd248e213 100644 --- a/plugins/ShareNotice/ShareNoticePlugin.php +++ b/plugins/ShareNotice/ShareNoticePlugin.php @@ -33,7 +33,7 @@ class ShareNoticePlugin extends Plugin ); function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/ShareNotice/css/sharenotice.css'); + $action->cssLink($this->path('css/sharenotice.css')); return true; } From 77769e4b3c9cb48fbbad13b8b2e17f29131c25cd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:51:58 -0500 Subject: [PATCH 19/22] YammerImport uses Plugin::path() --- plugins/YammerImport/actions/yammeradminpanel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/YammerImport/actions/yammeradminpanel.php b/plugins/YammerImport/actions/yammeradminpanel.php index 3faf390ac1..4714154290 100644 --- a/plugins/YammerImport/actions/yammeradminpanel.php +++ b/plugins/YammerImport/actions/yammeradminpanel.php @@ -176,12 +176,12 @@ class YammeradminpanelAction extends AdminPanelAction function showStylesheets() { parent::showStylesheets(); - $this->cssLink('plugins/YammerImport/css/admin.css', null, 'screen, projection, tv'); + $this->cssLink(Plugin::staticPath('YammerImport', 'css/admin.css'), null, 'screen, projection, tv'); } function showScripts() { parent::showScripts(); - $this->script('plugins/YammerImport/js/yammer-admin.js'); + $this->script(Plugin::staticPath('YammerImport', 'js/yammer-admin.js')); } } From 68cf2bdced6fab78639fed15d72a134ce2a3f657 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:04:54 -0500 Subject: [PATCH 20/22] Bookmark uses Plugin::path() --- plugins/Bookmark/BookmarkPlugin.php | 2 +- plugins/Bookmark/bookmarkpopup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 800a26e795..2e6baf5e4e 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -149,7 +149,7 @@ class BookmarkPlugin extends Plugin function onEndShowStyles($action) { - $action->cssLink('plugins/Bookmark/bookmark.css'); + $action->cssLink($this->path('bookmark.css')); return true; } diff --git a/plugins/Bookmark/bookmarkpopup.php b/plugins/Bookmark/bookmarkpopup.php index 24ed79612b..33f983a93a 100644 --- a/plugins/Bookmark/bookmarkpopup.php +++ b/plugins/Bookmark/bookmarkpopup.php @@ -107,6 +107,6 @@ class BookmarkpopupAction extends NewbookmarkAction function showScripts() { parent::showScripts(); - $this->script(common_path('plugins/Bookmark/bookmarkpopup.js')); + $this->script(Plugin::staticPath('Bookmark', 'bookmarkpopup.js')); } } From ffb7ca3e9939076285b7823048c0a5eae90cf3b8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:18:57 -0500 Subject: [PATCH 21/22] Realtime needs to load from own directory, not subclass's --- plugins/Realtime/RealtimePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 5d119982f5..246b1f9735 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -116,7 +116,7 @@ class RealtimePlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->cssLink($this->path('realtimeupdate.css'), + $action->cssLink(Plugin::staticPath('Realtime', 'realtimeupdate.css'), null, 'screen, projection, tv'); return true; @@ -323,7 +323,7 @@ class RealtimePlugin extends Plugin function _getScripts() { - return array($this->path('realtimeupdate.min.js')); + return array(Plugin::staticPath('Realtime', 'realtimeupdate.min.js')); } /** From 67b83bcca83293c29ea19ec9b0dd78159d9dc626 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:22:39 -0500 Subject: [PATCH 22/22] FacebookBridge use Plugin::path() --- plugins/FacebookBridge/actions/facebooklogin.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/FacebookBridge/actions/facebooklogin.php b/plugins/FacebookBridge/actions/facebooklogin.php index f8a45c41b2..924dd46565 100644 --- a/plugins/FacebookBridge/actions/facebooklogin.php +++ b/plugins/FacebookBridge/actions/facebooklogin.php @@ -89,10 +89,7 @@ class FacebookloginAction extends Action ); $attrs = array( - 'src' => common_path( - 'plugins/FacebookBridge/images/login-button.png', - true - ), + 'src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'), 'alt' => 'Login with Facebook', 'title' => 'Login with Facebook' );