in the template file denotes the location where $PageStart ends and $PageEnd begins. The HTML comment denotes where the contents of $HTMLHeaderFmt should be generated. The template file may also contain HTML comments of the form , , etc. These have the side effect of putting the strings that follow into the variables $PageHeaderFmt, $PageFooterFmt, etc. and then placing references to those variables into $PageStartFmt or $PageEndFmt. This allows HandleBrowse and other functions to selectively disable headers and footers by setting the corresponding variable to the empty string. Versions 0.6.1 and 0.6.2 made use of an $HTMLHeaders variable that is now deprecated, use and $HTMLHeaderFmt instead. */ SDV($FarmPubDirUrl,$PubDirUrl); SDV($PageTemplateFmt,"$FarmD/pub/skins/pmwiki/pmwiki.tmpl"); SDV($PageLogoUrl,"$FarmPubDirUrl/skins/pmwiki/pmwiki-32.gif"); SDV($PageLogoFmt,""); SDV($PageCSSListFmt,array( 'pub/css/local.css' => '$PubDirUrl/css/local.css', 'pub/css/$Group.css' => '$PubDirUrl/css/$Group.css', 'pub/css/$Group.$Title_.css' => '$PubDirUrl/css/$Group.$Title_.css')); foreach((array)$PageCSSListFmt as $k=>$v) if (file_exists(FmtPageName($k,$pagename))) $HTMLHeaderFmt[] = "\n"; if ($PageTemplateFmt) LoadPageTemplate($PageTemplateFmt); function LoadPageTemplate($tfilefmt) { global $PageStartFmt,$PageEndFmt,$BasicLayoutVars,$HTMLHeaderFmt; SDV($BasicLayoutVars,array('HeaderText','PageHeaderFmt','PageLeftFmt', 'PageTitleFmt', 'PageText','PageRightFmt','PageFooterFmt')); $k = str_replace('$HTMLHeaders','', # deprecated implode('',file(FmtPageName($tfilefmt,$pagename)))); $sect = preg_split('#[[<]!--(/?Page[A-Za-z]+Fmt|PageText|HeaderText)--[]>]#', $k,0,PREG_SPLIT_DELIM_CAPTURE); $PageStartFmt = array_merge(array('headers:'), preg_split('/[[<]!--((?:wiki|file|function):.*?)--[]>]/',array_shift($sect), 0,PREG_SPLIT_DELIM_CAPTURE)); $PageEndFmt = array(); $ps = 'PageStartFmt'; while (count($sect)>0) { $k = array_shift($sect); $v = preg_split('/[[<]!--((?:wiki|file|function):.*?)--[]>]/', array_shift($sect),0,PREG_SPLIT_DELIM_CAPTURE); if (substr($k,0,1)=='/') { $GLOBALS[$ps][] = ""; $GLOBALS[$ps][] = (count($v)>1) ? $v : $v[0]; continue; } $GLOBALS[$k] = (count($v)>1) ? $v : $v[0]; if (in_array($k,$BasicLayoutVars)) { $GLOBALS[$ps][] = ""; if ($k=='PageText') { $ps = 'PageEndFmt'; } if ($k=='HeaderText') $GLOBALS[$ps][] = &$HTMLHeaderFmt; $GLOBALS[$ps][] =& $GLOBALS[$k]; } } array_push($PageStartFmt,"\n
\n"); array_unshift($PageEndFmt,'
'); } ?>