diff --git a/inc/html.php b/inc/html.php index 8cac264b1b5912cd3472c8524d5f0a6d6d019f98..0e1364316dcdd09a70aae414cf51503ef7808ad4 100644 --- a/inc/html.php +++ b/inc/html.php @@ -8,6 +8,8 @@ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); + require_once(DOKU_INC.'inc/parserutils.php'); + /** * Convenience function to quickly build a wikilink * @@ -84,9 +86,12 @@ function html_login(){ ?> </div> <? +/* + FIXME provide new hook if(@file_exists('includes/login.txt')){ print io_cacheParse('includes/login.txt'); } +*/ } /** @@ -257,26 +262,28 @@ function html_list_toc($item){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function html_show($text=''){ +function html_show($txt=''){ global $ID; global $REV; global $HIGH; //disable section editing for old revisions or in preview if($text || $REV){ - global $parser; - $parser['secedit'] = false; + $secedit = false; + }else{ + $secedit = true; } - - if ($text){ + + if ($txt){ //PreviewHeader print p_locale_xhtml('preview'); print '<div class="preview">'; - print html_secedit(parse($text),false); + print html_secedit(p_render_xhtml(p_get_instructions($txt)),$secedit); print '</div>'; + }else{ if ($REV) print p_locale_xhtml('showrev'); $html = p_wiki_xhtml($ID,$REV,true); - $html = html_secedit($html); + $html = html_secedit($html,$secedit); print html_hilight($html,$HIGH); } } diff --git a/inc/parserutils.php b/inc/parserutils.php index efda5c85bb6732c5a55b80939269a4f7c52e6947..e2b4e9febd7ecf47d18ed49f1eb1221d3d984e48 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -30,7 +30,7 @@ function p_wiki_xhtml($id, $rev='', $excuse=true){ if($rev){ if(@file_exists($file)){ - $ret = p_render_xhtml(p_get_instructions($file)); //no caching on old revisions + $ret = p_render_xhtml(p_get_instructions(io_readfile($file))); //no caching on old revisions }elseif($excuse){ $ret = p_locale_xhtml('norev'); } @@ -131,7 +131,7 @@ function p_cached_instructions($file){ return unserialize(io_readfile($cache)); }elseif(@file_exists($file)){ // no cache - do some work - $ins = p_get_instructions($file); + $ins = p_get_instructions(io_readfile($file)); io_savefile($cache,serialize($ins)); return $ins; } @@ -145,11 +145,9 @@ function p_cached_instructions($file){ * @author Harry Fuecks <hfuecks@gmail.com> * @author Andreas Gohr <andi@splitbrain.org> */ -function p_get_instructions($file){ +function p_get_instructions($text){ global $conf; - $text = io_readfile($file); - require_once DOKU_INC . 'inc/parser/parser.php'; // Create the parser