"; /* * This is where all the themeing stuff is done. * Creates a list of themes, includes the required javascript, and adds the [[$Theme]] markup */ if ($ThemeEnable == 1 && $handle = opendir('.'.$ThemeDir)) { $StyleTagFmt = ""; $StyleAltList = ""; $theme = null; if($action=="theme"){ $theme = $_GET['newtheme']; setcookie ('wikitheme', $theme, time()+31536000, $HTTP_SERVER_VARS['SCRIPT_NAME'], $HTTP_SERVER_VARS['SERVER_NAME'], '0'); }else{ $theme = $_COOKIE['wikitheme']; } if($theme == null ){ $theme = $ThemeDefault; } while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && substr($file, -4) == ".css") { if($theme == substr($file,0,-4) ){ $StyleList = $StyleList . "\n"; }else{ $StyleAltList = $StyleAltList . "\n"; } $StyleTagFmt = $StyleTagFmt . "\n"; } } $StyleList = $StyleList . $StyleAltList; closedir($handle); $StyleTagFmt = ""; SDV($InlineReplacements['/\\[\\[\\$Theme\\]\\]/e'],"FmtPageName(\$GLOBALS['StyleTagFmt'],\$pagename)"); } //Stole a bit (4 lines) from ExternalCSS (Thanks!) Used to get group and title existance. if (preg_match("/^($GroupNamePattern)([.\\/]($PageTitlePattern))?\$/",$pagename,$match)) { $group=''; $title=''; $group = $match[1]; $title = @$match[3]; //Only include the stylesheets if they exist. if(file_exists(".".$GroupDir.$group.".css")) { $StyleList = $StyleList . "\n";} if(file_exists(".".$GroupDir.$group.".".$title.".css")) { $StyleList = $StyleList . "\n";} } $HTMLHeaderFmt = $StyleList; $HTMLBodyFmt = "\n"; $HTMLEndFmt = "\n"; $PageHeaderFmt = array( "\n", "\n
\n" ); $PageFooterFmt = "
\n\n"; $HandleSearchFmt = array( &$HTMLStartFmt, &$PageHeaderFmt, &$PageSearchFmt, &$PageFooterFmt, &$HTMLEndFmt ); $PageDiffFmt = array( &$PageHeaderFmt, $PageDiffFmt ); $PageDiffFootFmt = array( $PageDiffFootFmt, &$PageFooterFmt ); $PageEditFmt = "

Editing \$PageName


"; $HandleEditFmt = array ( &$HTMLStartFmt, &$PageHeaderFmt, &$PageEditFmt, "wiki:PmWiki.EditQuickReference", &$PagePreviewFmt, &$PageFooterFmt, &$HTMLEndFmt ); ?>