From: Carsten K. <car...@us...> - 2002-01-03 00:09:21
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv25830 Modified Files: stdlib.php Template.php Log Message: CSS now stored in an array, and <link rel="stylesheet"> headers are dynamically generated. - Simplifies xhtml templates. - Easier to add new alternate stylesheets in index.php without using themes. - Any stylesheets defined by a theme now works together with any default stylesheets (i.e. phpwiki.css, phpwiki-printer.css, phpwiki-modern.css) instead of completely replacing them. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -r1.63 -r1.64 *** stdlib.php 2001/12/28 09:53:24 1.63 --- stdlib.php 2002/01/03 00:09:18 1.64 *************** *** 54,57 **** --- 54,69 ---- } + function CSS_URL($CSS_URLS, $CSS_DEFAULT) { + $html = ""; + foreach ($CSS_URLS as $key => $val) { + if ($CSS_DEFAULT == $key) { + $html .= "<link rel=\"stylesheet\" title=\"".htmlspecialchars($key)."\" href=\"". DataURL(htmlspecialchars($val))."\" type=\"text/css\" />\n"; + } else { + $html .= "<link rel=\"alternate stylesheet\" title=\"".htmlspecialchars($key)."\" href=\"". DataURL(htmlspecialchars($val))."\" type=\"text/css\" />\n"; + } + } + return $html; + } + define('NO_END_TAG_PAT', '/^' . join('|', array('area', 'base', 'basefont', Index: Template.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/Template.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** Template.php 2001/12/30 06:10:45 1.8 --- Template.php 2002/01/03 00:09:18 1.9 *************** *** 273,281 **** function setGlobalTokens () { ! global $user, $logo, $CSS_URL, $RCS_IDS; // FIXME: This a a bit of dangerous hackage. $this->qreplace('BROWSE', WikiURL('')); ! $this->qreplace('CSS_URL', DataURL($CSS_URL)); $this->qreplace('WIKI_NAME', WIKI_NAME); --- 273,281 ---- function setGlobalTokens () { ! global $user, $logo, $CSS_URLS, $CSS_DEFAULT, $RCS_IDS; // FIXME: This a a bit of dangerous hackage. $this->qreplace('BROWSE', WikiURL('')); ! $this->replace('CSS', CSS_URL($CSS_URLS, $CSS_DEFAULT)); $this->qreplace('WIKI_NAME', WIKI_NAME); |