From: Mr. E23 Date: Fri, 26 Mar 2004 19:02:24 +0000 (+0000) Subject: Experimental support for WikiHiero X-Git-Tag: 1.3.0beta1~692 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=80da50e5f6c1f79d074d89f4df7b026e4cad2f7e;p=lhc%2Fweb%2Fwiklou.git Experimental support for WikiHiero --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9b9bcd0534..cb7123f6ff 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -202,6 +202,12 @@ $wgWLCacheTimeout = 3600; # The hour or so mentioned above $wgUseTeX = false; $wgTexvc = "./math/texvc"; # Location of the texvc binary +# Support for inline hieroglyphs, see http://aoineko.free.fr/ The +# WikiHiero php files must be present in the same directory as the +# rest of the mediawiki code, and WikiHiero must have been configured +# with the correct image locations. +$wgUseWikiHiero = false; + # Profiling / debugging $wgProfiling = false; # Enable for more detailed by-function times in debug log $wgProfileLimit = 0.0; # Only record profiling info for pages that took longer than this diff --git a/includes/Parser.php b/includes/Parser.php index c9b445c082..d6fca64fbb 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2,6 +2,10 @@ include_once('Tokenizer.php'); +if( $GLOBALS['wgUseWikiHiero'] ){ + include_once('wikihiero.php'); +} + # PHP Parser # # Processes wiki markup @@ -147,6 +151,16 @@ class Parser } } + if( $GLOBALS['wgUseWikiHiero'] ){ + $text = Parser::extractTags("hiero", $text, $hiero_content, $uniq_prefix); + foreach( $hiero_content as $marker => $content ){ + if( $render ){ + $hiero_content[$marker] = WikiHiero( $content, WH_MODE_HTML); + } else { + $hiero_content[$marker] = "$content"; + } + } + } if( $this->mOptions->getUseTeX() ){ $text = Parser::extractTags("math", $text, $math_content, $uniq_prefix); @@ -168,7 +182,7 @@ class Parser } } - $state = array( $nowiki_content, $math_content, $pre_content ); + $state = array( $nowiki_content, $hiero_content, $math_content, $pre_content ); return $text; } @@ -1077,7 +1091,6 @@ class Parser { global $wgVariableIDs; $this->mVariables = array(); - foreach ( $wgVariableIDs as $id ) { $mw =& MagicWord::get( $id ); $mw->addToArray( $this->mVariables, $this->getVariableValue( $id ) );