This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. **********************************************************************/ $InsideTMenu = 0; function BuildTMenu($name) { global $PubDirUrl, $HTMLHeaderFmt, $InsideTMenu; if ($name == 'tmenu') { $InsideTMenu = 1; return "<:block>
"; } if ($name == 'tmenuend') { $InsideTMenu = 0; return '<:block>
'; } return '<:block>'; } function BuildTItem($star,$tail) { global $InsideTMenu, $pagename, $DefaultPage; if( $InsideTMenu ) { $prefix = "%tmenuitem% "; if( preg_match("/^\\s*\\[\\[([^|]*?)(\\|.*?)?\\]\\]/", $tail, $match ) ) { $pn = MakePageName( $DefaultPage, $match[1] ); if( $pn == $pagename ) { $prefix = "%tmenucurrent% "; } } $tail = $prefix . $tail . " %%"; } return $star . $tail; } ## precede link handlers Markup('tmenu','tmenu','/^(\\*+)(.*)/e', "BuildTItem('$1','$2')"); ?>