* @param array $options Additional options:
* <pre>
* 'additional' - (array) TODO
- * 'sub' - (string) TODO
+ * 'sub' - (string) A subdirectory containing additional CSS files to
+ * load as an overlay to the base CSS files.
* </pre>
*/
static public function includeStylesheetFiles($options = array())
}
}
+ /* Add user-defined additional stylesheets. */
+ try {
+ $css = array_merge($css, self::callHook('cssfiles', array($theme), 'horde'));
+ } catch (Horde_Exception_HookNotSet $e) {}
+ if ($curr_app != 'horde') {
+ try {
+ $css = array_merge($css, self::callHook('cssfiles', array($theme), $curr_app));
+ } catch (Horde_Exception_HookNotSet $e) {}
+ }
+
$css_out = array();
foreach ($css as $f => $u) {
if (file_exists($f)) {
* [mixed] - The data to send to the browser (will be JSON encoded).
*
*
+ * CSS Hooks
+ * =========
+ *
+ * cssfiles
+ * --------
+ * This hook allows additional CSS stylesheets to be added to the page
+ * output.
+ *
+ * Parameters in:
+ * $theme (string): The current theme.
+ *
+ * The return value from this hook is as follows:
+ * [throw Horde_Ajax_Exception] - Fatal error.
+ * [array] - An array of CSS files to add. Keys are the filesystem location,
+ * values are the URI location.
+ *
+ *
* TODO: groupldap, share_add, share_modify, share_remove
*
* $Id$
// // Code to run if the app is switched to horde
// }
+ // Add CSS files hook. See above for description of format.
+// function cssfiles($theme)
+// {
+// return array(
+// '/file/path/to/css' => 'uri/to/css'
+// );
+// }
+
/**
* Allow altering or validating data submitted by a user during a signup
* request before any attempts are made to add them to the system.
v4.0-cvs
--------
+[mms] Add 'cssfiles' hook to add custom CSS files to a page.
[jan] Add option to not automatically show all available shares.
[jan] Add option to disallow world permissions for user shares.
[mms] Allow Mozilla DNS prefetching to be turned off when displaying untrusted
<configtab name="dimp" desc="Dynamic View (dimp) Options">
<configsection name="dimp">
- <configlist name="css_files" required="false" desc="A list of additional CSS
- files to load from the imp/themes/ directory."/>
-
<configheader>ViewPort Settings</configheader>
<configsection name="viewport">
<configinteger name="buffer_pages" desc="The number of viewable pages to
switch ($imp_view) {
case 'dimp':
- $css = array();
- if (!empty($GLOBALS['conf']['dimp']['css_files'])) {
- foreach ($GLOBALS['conf']['css_files'] as $css_file) {
- $css[] = array(
- 'u' => $GLOBALS['registry']->get('themesuri') . '/' . $css_file,
- 'f' => $GLOBALS['registry']->get('themesfs') . '/' . $css_file
- );
- }
- }
- Horde::includeStylesheetFiles(array('additional' => $css, 'sub' => 'dimp'));
+ Horde::includeStylesheetFiles(array('sub' => 'dimp'));
break;
default: