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
=======
'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')),
{
$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.
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;
+ }
}
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'));
}
}
$action->element('img',
array('width' => 300,
'height' => 250,
- 'src' => common_path('plugins/BlankAd/redpixel.png')),
+ 'src' => $this->path('redpixel.png')),
'');
}
$action->element('img',
array('width' => 180,
'height' => 150,
- 'src' => common_path('plugins/BlankAd/redpixel.png')),
+ 'src' => $this->path('redpixel.png')),
'');
}
$action->element('img',
array('width' => 160,
'height' => 600,
- 'src' => common_path('plugins/BlankAd/redpixel.png')),
+ 'src' => $this->path('redpixel.png')),
'');
}
$action->element('img',
array('width' => 728,
'height' => 90,
- 'src' => common_path('plugins/BlankAd/redpixel.png')),
+ 'src' => $this->path('redpixel.png')),
'');
}
function onEndShowStyles($action)
{
- $action->cssLink('plugins/Bookmark/bookmark.css');
+ $action->cssLink($this->path('bookmark.css'));
return true;
}
function showScripts()
{
parent::showScripts();
- $this->script(common_path('plugins/Bookmark/bookmarkpopup.js'));
+ $this->script(Plugin::staticPath('Bookmark', 'bookmarkpopup.js'));
}
}
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'));
}
}
*/
function onEndShowScripts($action){
if (common_logged_in()) {
- $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js');
+ $action->script($this->path('jquery.DirectionDetector.js'));
}
}
);
$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'
);
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)
{
$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'),
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',
//
// 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));
{
$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;
}
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.
{
$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;
}
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;
}
}
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;
}
return $url;
}
}
- return common_path('plugins/OStatus/images/96px-Feed-icon.svg.png');
+
+ return Plugin::staticPath('OStatus', 'images/96px-Feed-icon.svg.png');
}
/**
function onEndShowStatusNetStyles($action)
{
- $action->cssLink('plugins/Realtime/realtimeupdate.css',
- null, 'screen, projection, tv');
+ $action->cssLink(Plugin::staticPath('Realtime', 'realtimeupdate.css'),
+ null,
+ 'screen, projection, tv');
return true;
}
function _getScripts()
{
- return array('plugins/Realtime/realtimeupdate.min.js');
+ return array(Plugin::staticPath('Realtime', 'realtimeupdate.min.js'));
}
/**
);
function onEndShowStatusNetStyles($action) {
- $action->cssLink('plugins/ShareNotice/css/sharenotice.css');
+ $action->cssLink($this->path('css/sharenotice.css'));
return true;
}
function onEndShowScripts($action)
{
- $action->script('plugins/TabFocus/tabfocus.js');
+ $action->script($this->path('tabfocus.js'));
}
function onPluginVersion(&$versions)
* 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
$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');
}
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'));
}
}