Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv9874
Modified Files:
stdlib.php
Log Message:
Optimized CSS_URL function, and added a kludge so the "Printer" stylesheet title can be localized.
Index: stdlib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** stdlib.php 2002/01/03 00:09:18 1.64
--- stdlib.php 2002/01/05 12:27:01 1.65
***************
*** 4,7 ****
--- 4,8 ----
Standard functions for Wiki functionality
WikiURL($pagename, $args, $abs)
+ CSS_URL($CSS_URLS, $CSS_DEFAULT)
LinkWikiWord($wikiword, $linktext)
LinkExistingWikiWord($wikiword, $linktext)
***************
*** 55,65 ****
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;
--- 56,72 ----
function CSS_URL($CSS_URLS, $CSS_DEFAULT) {
+ // FIXME: This is a kludge to allow xgettext to localize the title
+ // of the printer stylesheet. Think up a more elegant way which
+ // will also work with n stylesheets...
+ $PrinterStylesheetTitle = _("Printer");
+
$html = "";
foreach ($CSS_URLS as $key => $val) {
! $html .= QElement('link',
! array('rel' => (($CSS_DEFAULT == $key) ?
! 'stylesheet' : 'alternate stylesheet'),
! 'title' => _(htmlspecialchars($key)),
! 'href' => DataURL(htmlspecialchars($val)),
! 'type' => 'text/css'))."\n";
}
return $html;
|