summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-21 17:16:42 +0200
committerBrion Vibber <brion@pobox.com>2010-06-07 18:14:16 -0700
commit09208f8d654336d710069c1b4843de7e0d8c5d20 (patch)
tree1b512dc3891273b5eaf847e25dbe7fbbea98fc0d /lib/action.php
parent8e33cdd36a27178ea98e95fdb9d17391eaec5838 (diff)
Basic custom CSS and theme uploading features. 'local' subdir can now be customized to a distinct directory and URL path to make it easier to separate custom themes for a multi-site farm running a common code base.
Currently only one custom theme may be uploaded per site, saved with the name 'custom' and stored into the local/themes subdirectory. Administrators can upload a .ZIP archive containing a theme through the design admin panel; its contents are validated to ensure that only legit files are saved, and a 5M size quota is enforced. Theme upload requires the zip extension for PHP; if not present, theme uploading is disabled by default. Uploading and the custom CSS can be controlled via $config['theme_upload']['enabled'] and $config['custom_css']['enabled']. Configurable directory/path/server for 'local' subdirectory (currently only as used for themes; local plugins not yet switched over) Can set $config['local']['dir'] etc; not currently exposed in the admin panels. Per-site directories on a separate themes server could be set up such as: $config['local']['dir'] = '/path/to/themes/local/' . $_nickname; $config['local']['server'] = 'themes.example.com'; $config['local']['path'] = '/local/' . $_nickname; $config['local']['ssl'] = 'never';
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/action.php b/lib/action.php
index c4d9fd5cb..22ea4f275 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -233,6 +233,16 @@ class Action extends HTMLOutputter // lawsuit
Event::handle('EndShowDesign', array($this));
}
Event::handle('EndShowStyles', array($this));
+
+ if (common_config('custom_css', 'enabled')) {
+ $css = common_config('custom_css', 'css');
+ if (Event::handle('StartShowCustomCss', array($this, &$css))) {
+ if (trim($css) != '') {
+ $this->style($css);
+ }
+ Event::handle('EndShowCustomCss', array($this));
+ }
+ }
}
}