r2846 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2845‎ | r2846 | r2847 >
Date:19:02, 26 March 2004
Author:e23
Status:old
Tags:
Comment:
Experimental support for WikiHiero
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -202,6 +202,12 @@
203203 $wgUseTeX = false;
204204 $wgTexvc = "./math/texvc"; # Location of the texvc binary
205205
 206+# Support for inline hieroglyphs, see http://aoineko.free.fr/ The
 207+# WikiHiero php files must be present in the same directory as the
 208+# rest of the mediawiki code, and WikiHiero must have been configured
 209+# with the correct image locations.
 210+$wgUseWikiHiero = false;
 211+
206212 # Profiling / debugging
207213 $wgProfiling = false; # Enable for more detailed by-function times in debug log
208214 $wgProfileLimit = 0.0; # Only record profiling info for pages that took longer than this
Index: trunk/phase3/includes/Parser.php
@@ -2,6 +2,10 @@
33
44 include_once('Tokenizer.php');
55
 6+if( $GLOBALS['wgUseWikiHiero'] ){
 7+ include_once('wikihiero.php');
 8+}
 9+
610 # PHP Parser
711 #
812 # Processes wiki markup
@@ -147,6 +151,16 @@
148152 }
149153 }
150154
 155+ if( $GLOBALS['wgUseWikiHiero'] ){
 156+ $text = Parser::extractTags("hiero", $text, $hiero_content, $uniq_prefix);
 157+ foreach( $hiero_content as $marker => $content ){
 158+ if( $render ){
 159+ $hiero_content[$marker] = WikiHiero( $content, WH_MODE_HTML);
 160+ } else {
 161+ $hiero_content[$marker] = "<hiero>$content</hiero>";
 162+ }
 163+ }
 164+ }
151165
152166 if( $this->mOptions->getUseTeX() ){
153167 $text = Parser::extractTags("math", $text, $math_content, $uniq_prefix);
@@ -168,7 +182,7 @@
169183 }
170184 }
171185
172 - $state = array( $nowiki_content, $math_content, $pre_content );
 186+ $state = array( $nowiki_content, $hiero_content, $math_content, $pre_content );
173187
174188 return $text;
175189 }
@@ -1077,7 +1091,6 @@
10781092 {
10791093 global $wgVariableIDs;
10801094 $this->mVariables = array();
1081 -
10821095 foreach ( $wgVariableIDs as $id ) {
10831096 $mw =& MagicWord::get( $id );
10841097 $mw->addToArray( $this->mVariables, $this->getVariableValue( $id ) );

Status & tagging log