?>
<title><?php echo $page_title ?></title>
-<?php echo Horde::stylesheetLink('babel') ?>
+<?php Horde::includeStylesheetFiles('babel') ?>
</head>
<body<?php if (Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass . '"' ?>>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir() ?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('chora') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('skeleton') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('fima', empty($print_view) ? '' : 'print') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'activity') ?>" title="<?php echo _("Friends activity") ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'know') ?>" title="<?php echo _("People you might know") ?>" />
<?php endif; ?>
-<?php echo Horde::stylesheetLink('folks') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('gollem') ?>
+<?php Horde::includeStylesheetFiles() ?>
<?php Horde::outputInlineScript(); ?>
</head>
DIMP::header(_("Message Composition"), $scripts);
echo $t->fetch('compose.html');
-IMP::includeScriptFiles();
+Horde::includeScriptFiles();
Horde::outputInlineScript();
echo $compose_result['jsappend'];
echo "</body>\n</html>";
next login. If IMP will be the exclusive means of accessing the mail server,
or you are not concerned about this behavior, this setting should be set to
true.">true</configboolean>
- <configswitch name="cachejs" desc="Cache static javascript and combine into
- a single page for delivery to the remote browser?">none
- <case name="none" desc="No" />
- <case name="filesystem" desc="Filesystem">
- <configsection name="cachejsparams">
- <configphp name="file_location" desc="The filesystem directory to write
- the static files to. THIS DIRECTORY MUST BE AVAILABLE ON THE SERVER
- RUNNING PHP AND MUST BE WRITABLE BY THE PHP USER."></configphp>
- <configphp name="file_url" desc="The corresponding base URL to use to
- access the static files."></configphp>
- <configinteger name="lifetime" desc="Lifetime, in seconds, after which
- the garbage collector will remove static files.">86400</configinteger>
- </configsection>
- </case>
- <case name="horde_cache" desc="Horde_Cache">
- <configdescription>
- <strong>Requires a configured Horde_Cache backend.</strong>
- </configdescription>
- <configsection name="cachejsparams">
- <configinteger name="lifetime" desc="Cache lifetime, in seconds.">
- 86400</configinteger>
- </configsection>
- </case>
- </configswitch>
- <configswitch name="cachecss" desc="Cache static CSS and combine into
- a single page for delivery to the remote browser?">none
- <case name="none" desc="No" />
- <case name="filesystem" desc="Filesystem">
- <configsection name="cachecssparams">
- <configphp name="file_location" desc="The filesystem directory to write
- the static files to. THIS DIRECTORY MUST BE AVAILABLE ON THE SERVER
- RUNNING PHP AND MUST BE WRITABLE BY THE PHP USER."></configphp>
- <configphp name="file_url" desc="The corresponding base URL to use to
- access the static files."></configphp>
- <configinteger name="lifetime" desc="Lifetime, in seconds, after which
- the garbage collector will remove static files.">86400</configinteger>
- </configsection>
- </case>
- <case name="horde_cache" desc="Horde_Cache">
- <configdescription>
- <strong>Requires a configured Horde_Cache backend.</strong>
- </configdescription>
- <configsection name="cachecssparams">
- <configinteger name="lifetime" desc="Cache lifetime, in seconds.">
- 86400</configinteger>
- </configsection>
- </case>
- </configswitch>
</configsection>
</configtab>
</configtab>
<configtab name="dimp" desc="Dynamic View (dimp) Options">
- <configheader>Custom Hooks</configheader>
<configsection name="dimp">
<configlist name="css_files" required="false" desc="A list of additional CSS
files to load from the imp/themes/ directory."/>
v5.0-git
--------
+[mms] Move JS/CSS caching to Horde framework.
[mms] Add simple search function to MIMP.
[mms] DIMP now honors the 'mailbox_start' preference.
[mms] Logins now handled by Horde login handler.
echo "<body>\n";
require IMP_TEMPLATES . '/index/index-dimp.inc';
-IMP::includeScriptFiles();
+Horde::includeScriptFiles();
Horde::outputInlineScript();
$notification->notify(array('listeners' => array('javascript')));
echo "</body>\n</html>";
/* hideDeletedMsgs() cache. */
static private $_delhide = null;
- /* filesystemGC() cache. */
- static private $_dirlist = array();
-
/* Has init previously been called? */
static private $_init = false;
}
/**
- * Outputs the necessary script tags, honoring local configuration
- * choices as to script caching.
- */
- static public function includeScriptFiles()
- {
- global $conf;
-
- $cache_type = @$conf['server']['cachejs'];
-
- if (empty($cache_type) ||
- $cache_type == 'none' ||
- (($cache_type == 'horde_cache') &&
- !($cache = self::getCache()))) {
- Horde::includeScriptFiles();
- return;
- }
-
- $js_tocache = $js_force = array();
- $mtime = array(0);
-
- $s_list = Horde::listScriptFiles();
- foreach ($s_list as $app => $files) {
- foreach ($files as $file) {
- if ($file['d'] && ($file['f'][0] != '/')) {
- $js_tocache[$file['p'] . $file['f']] = false;
- $mtime[] = filemtime($file['p'] . $file['f']);
- } else {
- $js_force[] = $file['u'];
- }
- }
- }
-
- sort($s_list);
-
- require_once IMP_BASE . '/lib/version.php';
- $sig = hash('md5', serialize($s_list) . max($mtime) . IMP_VERSION);
-
- switch ($cache_type) {
- case 'filesystem':
- $js_filename = '/' . $sig . '.js';
- $js_path = $conf['server']['cachejsparams']['file_location'] . $js_filename;
- $js_url = $conf['server']['cachejsparams']['file_url'] . $js_filename;
- $exists = file_exists($js_path);
- break;
-
- case 'horde_cache':
- // Do lifetime checking here, not on cache display page.
- $exists = $cache->exists($sig, empty($conf['server']['cachejsparams']['lifetime']) ? 0 : $conf['server']['cachejsparams']['lifetime']);
- $js_url = Horde::getCacheUrl('js', array('cid' => $sig));
- break;
- }
-
- if (!$exists) {
- $out = '';
- foreach ($js_tocache as $key => $val) {
- // Separate JS files with a newline since some compressors may
- // strip trailing terminators.
- if ($val) {
- // Minify these files a bit by removing newlines and
- // comments.
- $out .= preg_replace(array('/\n+/', '/\/\*.*?\*\//'), array('', ''), file_get_contents($key)) . "\n";
- } else {
- $out .= file_get_contents($key) . "\n";
- }
- }
-
- switch ($cache_type) {
- case 'filesystem':
- register_shutdown_function(array('IMP', 'filesystemGC'), 'js');
- file_put_contents($js_path, $out);
- break;
-
- case 'horde_cache':
- $cache->set($sig, $out);
- break;
- }
- }
-
- foreach (array_merge(array($js_url), $js_force) as $val) {
- echo '<script type="text/javascript" src="' . $val . "\"></script>\n";
- }
- }
-
- /**
- * Outputs the necessary style tags, honoring local configuration
- * choices as to stylesheet caching.
- *
- * @param string $app The application to load ('dimp' or 'imp').
- */
- static public function includeStylesheetFiles($app = 'imp')
- {
- global $conf, $prefs, $registry;
-
- $theme = $prefs->getValue('theme');
- $themesfs = $registry->get('themesfs');
- $themesuri = $registry->get('themesuri');
- if ($app == 'imp') {
- $css = Horde::getStylesheets('imp', $theme);
- } else {
- $css = self::_getDIMPStylesheets($theme);
- }
- $css_out = array();
-
- if ($app == 'dimp') {
- // Load custom stylesheets.
- if (!empty($conf['dimp']['css_files'])) {
- foreach ($conf['css_files'] as $css_file) {
- $css[] = array('u' => $themesuri . '/' . $css_file,
- 'f' => $themesfs . '/' . $css_file);
- }
- }
- }
-
- $cache_type = @$conf['server']['cachecss'];
-
- if (empty($cache_type) ||
- $cache_type == 'none' ||
- (($cache_type == 'horde_cache') &&
- !($cache = self::getCache()))) {
- $css_out = array_merge($css, $css_out);
- } else {
- $mtime = array(0);
- $out = '';
-
- foreach ($css as $file) {
- $mtime[] = filemtime($file['f']);
- }
-
- require_once IMP_BASE . '/lib/version.php';
- $sig = hash('md5', serialize($css) . max($mtime) . IMP_VERSION);
-
- switch ($cache_type) {
- case 'filesystem':
- $css_filename = '/' . $sig . '.css';
- $css_path = $conf['server']['cachecssparams']['file_location'] . $css_filename;
- $css_url = $conf['server']['cachecssparams']['file_url'] . $css_filename;
- $exists = file_exists($css_path);
- break;
-
- case 'horde_cache':
- // Do lifetime checking here, not on cache display page.
- $exists = $cache->exists($sig, empty($GLOBALS['conf']['server']['cachecssparams']['lifetime']) ? 0 : $GLOBALS['conf']['server']['cachecssparams']['lifetime']);
- $css_url = Horde::getCacheUrl('css', array('cid' => $sig));
- break;
- }
-
- if (!$exists) {
- $flags = defined('FILE_IGNORE_NEW_LINES') ? (FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : 0;
- foreach ($css as $file) {
- $path = substr($file['u'], 0, strrpos($file['u'], '/') + 1);
-
- // Fix relative URLs, convert graphics URLs to data URLs
- // (if possible), remove multiple whitespaces, and strip
- // comments.
- $tmp = preg_replace(array('/(url\(["\']?)([^\/])/i', '/\s+/', '/\/\*.*?\*\//'), array('$1' . $path . '$2', ' ', ''), implode('', file($file['f'], $flags)));
- if ($GLOBALS['browser']->hasFeature('dataurl')) {
- $tmp = preg_replace_callback('/(background(?:-image)?:[^;}]*(?:url\(["\']?))(.*?)((?:["\']?\)))/i', array('IMP', 'stylesheetCallback'), $tmp);
- }
- $out .= $tmp;
- }
-
- /* Use CSS tidy to clean up file. */
- try {
- $out = Horde_Text_Filter::filter($out, 'csstidy');
- } catch (Horde_Exception $e) {}
-
- switch ($cache_type) {
- case 'filesystem':
- register_shutdown_function(array('IMP', 'filesystemGC'), 'css');
- file_put_contents($css_path, $out);
- break;
-
- case 'horde_cache':
- $cache->set($sig, $out);
- break;
- }
- }
-
- $css_out = array_merge(array(array('u' => $css_url)), $css_out);
- }
-
- foreach ($css_out as $file) {
- echo '<link href="' . $file['u'] . "\" rel=\"stylesheet\" type=\"text/css\" />\n";
- }
- }
-
- /**
- * TODO - Move to Horde core
- */
- public function stylesheetCallback($matches)
- {
- return $matches[1] . Horde::base64ImgData($matches[2]) . $matches[3];
- }
-
- /**
- * TODO - Temporary DIMP fix/Merge to Horde core
- */
- private function _getDIMPStylesheets($theme = '')
- {
- if ($theme === '' && isset($GLOBALS['prefs'])) {
- $theme = $GLOBALS['prefs']->getValue('theme');
- }
-
- $css = array();
- $rtl = isset($GLOBALS['nls']['rtl'][$GLOBALS['language']]);
-
- /* Collect browser specific stylesheets if needed. */
- $browser_css = array();
-
- switch ($GLOBALS['browser']->getBrowser()) {
- case 'msie':
- $ie_major = $GLOBALS['browser']->getMajor();
- // TODO: IE8 specific styling
- if ($ie_major >= 7) {
- $browser_css[] = 'ie7.css';
- $browser_css[] = 'ie7-dimp.css';
- } elseif ($ie_major < 7) {
- $browser_css[] = 'ie6_or_less.css';
- $browser_css[] = 'ie6_or_less-dimp.css';
- if ($GLOBALS['browser']->getPlatform() == 'mac') {
- $browser_css[] = 'ie5mac.css';
- }
- }
- break;
-
- case 'opera':
- $browser_css[] = 'opera.css';
- break;
-
- case 'mozilla':
- if ($GLOBALS['browser']->getMajor() >= 5 &&
- preg_match('/rv:(.*)\)/', $GLOBALS['browser']->getAgentString(), $revision) &&
- $revision[1] <= 1.4) {
- $browser_css[] = 'moz14.css';
- }
- break;
-
- case 'webkit':
- $browser_css[] = 'webkit.css';
- }
-
- foreach (array('horde', 'imp') as $app) {
- $themes_fs = $GLOBALS['registry']->get('themesfs', $app);
- $themes_uri = Horde::url($GLOBALS['registry']->get('themesuri', $app), false, -1);
- $css[] = array('u' => $themes_uri . '/screen.css', 'f' => $themes_fs . '/screen.css');
- if ($app == 'imp') {
- $css[] = array('u' => $themes_uri . '/screen-dimp.css', 'f' => $themes_fs . '/screen-dimp.css');
- }
- if (!empty($theme)) {
- if (file_exists($themes_fs . '/' . $theme . '/screen.css')) {
- $css[] = array('u' => $themes_uri . '/' . $theme . '/screen.css', 'f' => $themes_fs . '/' . $theme . '/screen.css');
- }
- if (($app == 'imp') &&
- file_exists($themes_fs . '/' . $theme . '/screen-dimp.css')) {
- $css[] = array('u' => $themes_uri . '/' . $theme . '/screen-dimp.css', 'f' => $themes_fs . '/' . $theme . '/screen-dimp.css');
- }
- }
-
- if ($rtl) {
- $css[] = array('u' => $themes_uri . '/rtl.css', 'f' => $themes_fs . '/rtl.css');
- if (!empty($theme) &&
- file_exists($themes_fs . '/' . $theme . '/rtl.css')) {
- $css[] = array('u' => $themes_uri . '/' . $theme . '/rtl.css', 'f' => $themes_fs . '/' . $theme . '/rtl.css');
- }
- }
- foreach ($browser_css as $browser) {
- if (file_exists($themes_fs . '/' . $browser)) {
- $css[] = array('u' => $themes_uri . '/' . $browser, 'f' => $themes_fs . '/' . $browser);
- }
- if (!empty($theme) &&
- file_exists($themes_fs . '/' . $theme . '/' . $browser)) {
- $css[] = array('u' => $themes_uri . '/' . $theme . '/' . $browser, 'f' => $themes_fs . '/' . $theme . '/' . $browser);
- }
- }
- }
-
- return $css;
- }
-
- /**
- * Do garbage collection in the statically served file directory.
- *
- * @param string $type Either 'css' or 'js'.
- */
- static public function filesystemGC($type)
- {
- $dir_list = &self::$_dirlist;
-
- $ptr = $GLOBALS['conf']['server'][(($type == 'css') ? 'cachecssparams' : 'cachejsparams')];
- $dir = $ptr['file_location'];
- if (in_array($dir, $dir_list)) {
- return;
- }
-
- $c_time = time() - $ptr['lifetime'];
- $d = dir($dir);
- $dir_list[] = $dir;
-
- while (($entry = $d->read()) !== false) {
- $path = $dir . '/' . $entry;
- if (in_array($entry, array('.', '..'))) {
- continue;
- }
-
- if ($c_time > filemtime($path)) {
- $old_error = error_reporting(0);
- unlink($path);
- error_reporting($old_error);
- }
- }
- $d->close();
- }
-
- /**
* Returns a Horde_Cache object (if configured) and handles any errors
* associated with creating the object.
*
DIMP::header($show_msg_result['subject'], $scripts);
echo "<body>\n";
require IMP_TEMPLATES . '/chunks/message.php';
-IMP::includeScriptFiles();
+Horde::includeScriptFiles();
Horde::outputInlineScript();
if (!$disable_compose) {
echo $compose_result['jsappend'];
switch ($imp_view) {
case 'dimp':
include IMP_TEMPLATES . '/javascript_defs_dimp.php';
- IMP::includeStylesheetFiles('dimp');
+
+ $css = array();
+ if (!empty($GLOBALS['conf']['dimp']['css_files'])) {
+ foreach ($GLOBALS['conf']['css_files'] as $css_file) {
+ $css[] = array(
+ 'u' => $themesuri . '/' . $css_file,
+ 'f' => $themesfs . '/' . $css_file
+ );
+ }
+ }
+
+ Horde::includeStylesheetFiles(array('additional' => $css, 'sub' => 'dimp'));
break;
default:
include IMP_TEMPLATES . '/javascript_defs.php';
- IMP::includeScriptFiles();
- IMP::includeStylesheetFiles();
+ Horde::includeScriptFiles();
+ Horde::includeStylesheetFiles();
break;
}
?>
<?php Horde::includeScriptFiles(); ?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('ingo') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<head>
<title><?php echo htmlspecialchars($registry->get('name')) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('horde') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('kastalia') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('koward', empty($this->print_view) ? $this->theme : 'print') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
Kronolith::header('', $scripts);
echo "<body class=\"kronolithAjax\">\n";
require KRONOLITH_TEMPLATES . '/index/index.inc';
-Kronolith::includeScriptFiles();
+Horde::includeScriptFiles();
Horde::outputInlineScript();
$notification->notify(array('listeners' => array('javascript')));
$tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'kronolithEventTags', 'pretty' => true));
'<link href="' . $GLOBALS['registry']->getImageDir() . "/favicon.ico\" rel=\"SHORTCUT ICON\" />\n".
Horde::wrapInlineScript(self::includeJSVars());
- self::includeStylesheetFiles(true);
+ Horde::includeStylesheetFiles();
echo "</head>\n";
}
/**
- * Outputs the necessary script tags, honoring local configuration choices
- * as to script caching.
- */
- public static function includeScriptFiles()
- {
- global $conf;
-
- $cache_type = @$conf['server']['cachejs'];
-
- if (empty($cache_type) ||
- $cache_type == 'none' ||
- ($cache_type == 'horde_cache' &&
- $conf['cache']['driver'] == 'none')) {
- Horde::includeScriptFiles();
- return;
- }
-
- $js_tocache = $js_force = array();
- $mtime = array(0);
-
- $s_list = Horde::listScriptFiles();
- foreach ($s_list as $app => $files) {
- foreach ($files as $file) {
- if ($file['d'] && ($file['f'][0] != '/')) {
- $js_tocache[$file['p'] . $file['f']] = false;
- $mtime[] = filemtime($file['p'] . $file['f']);
- } else {
- $js_force[] = $file['u'];
- }
- }
- }
-
- require_once KRONOLITH_BASE . '/lib/version.php';
- $sig = hash('md5', serialize($s_list) . max($mtime) . KRONOLITH_VERSION);
-
- switch ($cache_type) {
- case 'filesystem':
- $js_filename = '/' . $sig . '.js';
- $js_path = $conf['server']['cachejsparams']['file_location'] . $js_filename;
- $js_url = $conf['server']['cachejsparams']['file_url'] . $js_filename;
- $exists = file_exists($js_path);
- break;
-
- case 'horde_cache':
- $cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
- $exists = $cache->exists($sig, empty($conf['server']['cachejsparams']['lifetime']) ? 0 : $conf['server']['cachejsparams']['lifetime']);
- $js_url = self::getCacheURL('js', $sig);
- break;
- }
-
- if (!$exists) {
- $out = '';
- foreach ($js_tocache as $key => $val) {
- // Separate JS files with a newline since some compressors may
- // strip trailing terminators.
- if ($val) {
- // Minify these files a bit by removing newlines and
- // comments.
- $out .= preg_replace(array('/\n+/', '/\/\*.*?\*\//'), array('', ''), file_get_contents($key)) . "\n";
- } else {
- $out .= file_get_contents($key) . "\n";
- }
- }
-
- switch ($cache_type) {
- case 'filesystem':
- register_shutdown_function(array('Kronolith', '_filesystemGC'), 'js');
- file_put_contents($js_path, $out);
- break;
-
- case 'horde_cache':
- $cache->set($sig, $out);
- break;
- }
- }
-
- foreach (array_merge(array($js_url), $js_force) as $val) {
- echo '<script type="text/javascript" src="' . $val . '"></script>' . "\n";
- }
- }
-
- /**
- * Outputs the necessary style tags, honoring local configuration choices
- * as to stylesheet caching.
- *
- * @param boolean $print Include print CSS?
- */
- public static function includeStylesheetFiles($print = false)
- {
- global $conf, $prefs, $registry;
-
- $theme = $prefs->getValue('theme');
- $themesfs = $registry->get('themesfs');
- $themesuri = $registry->get('themesuri');
- $css = Horde::getStylesheets('kronolith', $theme);
- $css_out = array();
-
- // Add print specific stylesheets.
- if ($print) {
- // Add Horde print stylesheet
- $css_out[] = array('u' => $registry->get('themesuri', 'horde') . '/print/screen.css',
- 'f' => $registry->get('themesfs', 'horde') . '/print/screen.css',
- 'm' => 'print');
- $css_out[] = array('u' => $themesuri . '/print/screen.css',
- 'f' => $themesfs . '/print/screen.css',
- 'm' => 'print');
- if (file_exists($themesfs . '/' . $theme . '/print.css')) {
- $css_out[] = array('u' => $themesuri . '/' . $theme . '/print.css',
- 'f' => $themesfs . '/' . $theme . '/print.css',
- 'm' => 'print');
- }
- }
-
- // Load custom stylesheets.
- if (!empty($conf['css_files'])) {
- foreach ($conf['css_files'] as $css_file) {
- $css[] = array('u' => $themesuri . '/' . $css_file,
- 'f' => $themesfs . '/' . $css_file);
- }
- }
-
- $cache_type = @$conf['server']['cachecss'];
-
- if (empty($cache_type) ||
- $cache_type == 'none' ||
- ($cache_type == 'horde_cache' &&
- $conf['cache']['driver'] == 'none')) {
- $css_out = array_merge($css, $css_out);
- } else {
- $mtime = array(0);
- $out = '';
-
- foreach ($css as $file) {
- $mtime[] = filemtime($file['f']);
- }
-
- require_once KRONOLITH_BASE . '/lib/version.php';
- $sig = hash('md5', serialize($css) . max($mtime) . KRONOLITH_VERSION);
-
- switch ($cache_type) {
- case 'filesystem':
- $css_filename = '/' . $sig . '.css';
- $css_path = $conf['server']['cachecssparams']['file_location'] . $css_filename;
- $css_url = $conf['server']['cachecssparams']['file_url'] . $css_filename;
- $exists = file_exists($css_path);
- break;
-
- case 'horde_cache':
- $cache = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'], Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
- $exists = $cache->exists($sig, empty($GLOBALS['conf']['server']['cachecssparams']['lifetime']) ? 0 : $GLOBALS['conf']['server']['cachecssparams']['lifetime']);
- $css_url = self::getCacheURL('css', $sig);
- break;
- }
-
- if (!$exists) {
- $flags = defined('FILE_IGNORE_NEW_LINES') ? (FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : 0;
- foreach ($css as $file) {
- $path = substr($file['u'], 0, strrpos($file['u'], '/') + 1);
- // Fix relative URLs, remove multiple whitespaces, and
- // strip comments.
- $out .= preg_replace(array('/(url\(["\']?)([^\/])/i', '/\s+/', '/\/\*.*?\*\//'), array('$1' . $path . '$2', ' ', ''), implode('', file($file['f'], $flags)));
- }
-
- switch ($cache_type) {
- case 'filesystem':
- register_shutdown_function(array('Kronolith', '_filesystemGC'), 'css');
- file_put_contents($css_path, $out);
- break;
-
- case 'horde_cache':
- $cache->set($sig, $out);
- break;
- }
- }
-
- $css_out = array_merge(array(array('u' => $css_url)), $css_out);
- }
-
- foreach ($css_out as $file) {
- echo '<link href="' . $file['u'] . '" rel="stylesheet" type="text/css"' . (isset($file['m']) ? ' media="' . $file['m'] . '"' : '') . ' />' . "\n";
- }
- }
-
- /**
* Creates a URL for cached Kronolith data.
*
* @param string $type The cache type.
}
/**
- * Do garbage collection in the statically served file directory.
- *
- * @access private
- *
- * @param string $type Either 'css' or 'js'.
- */
- public static function _filesystemGC($type)
- {
- static $dir_list = array();
-
- $ptr = $GLOBALS['conf']['server'][(($type == 'css') ? 'cachecssparams' : 'cachejsparams')];
- $dir = $ptr['file_location'];
- if (in_array($dir, $dir_list)) {
- return;
- }
-
- $c_time = time() - $ptr['lifetime'];
- $d = dir($dir);
- $dir_list[] = $dir;
-
- while (($entry = $d->read()) !== false) {
- $path = $dir . '/' . $entry;
- if (in_array($entry, array('.', '..'))) {
- continue;
- }
-
- if ($c_time > filemtime($path)) {
- $old_error = error_reporting(0);
- unlink($path);
- error_reporting($old_error);
- }
- }
- $d->close();
- }
-
- /**
* Returns all the alarms active on a specific date.
*
* @param Horde_Date $date The date to check for alarms.
//]]></script>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('kronolith', empty($print_view) ? '' : 'print') ?>
+<?php Horde::includeStylesheetFiles() ?>
<?php foreach ($GLOBALS['display_calendars'] as $calendar): ?>
<link href="<?php echo Kronolith::feedUrl($calendar) ?>" rel="alternate" type="application/atom+xml" />
<?php endforeach; ?>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('nag', empty($print_view) ? '' : 'print') ?>
+<?php Horde::includeStylesheetFiles() ?>
<link href="<?php echo Horde::applicationUrl('themes/categoryCSS.php') ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $GLOBALS['registry']->get('jsuri', 'horde') ?>/glow/1.5.1/core/core.js" type="text/javascript"></script>
<script src="<?php echo $GLOBALS['registry']->get('jsuri', 'horde') ?>/glow/1.5.1/widgets/widgets.js" type="text/javascript"></script>
$version_data = unserialize($version_data);
-echo Horde::stylesheetLink('news');
+Horde::includeStylesheetFiles();
while (list($k, $v) = each($current_data)) {
echo '<hr><strong>' . $nls['languages'][$k] . '</strong><hr>' . "\n";
Horde::addScriptFile('tables.js', 'horde', true);
Horde::includeScriptFiles();
-echo Horde::stylesheetLink('news');
+Horde::includeStylesheetFiles();
// require_once NEWS_TEMPLATES . '/common-header.inc';
require_once NEWS_TEMPLATES . '/reads/header.inc';
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="alternate" title="<?php echo _("Last news") ?>" href="<?php echo Horde::applicationUrl('rss/news.php', true, -1) ?>" type="application/rss+xml" />
<link rel="alternate" title="<?php echo _("Last comments") ?>" href="<?php echo Horde::applicationUrl('rss/comments.php', true, -1) ?>" type="application/rss+xml" />
-<?php echo Horde::stylesheetLink('news') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('skoli') ?>
+<?php Horde::includeStylesheetFiles() ?>
<link href="<?php echo Horde::applicationUrl('themes/categoryCSS.php') ?>" rel="stylesheet" type="text/css" />
</head>
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php echo Horde::stylesheetLink('turba', empty($GLOBALS['print_view']) ? '' : 'print') ?>
+<?php Horde::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>