'PatchOutput,HTMLets', 'version' => ExtPatchOutput::$mVersion, 'author' => 'User:RV1971, Daniel Kinzler, Brian Mingus ', 'url' => 'http://www.mediawiki.org/wiki/Extension:PatchOutput', 'description' => 'Code comes from PatchOutput and HTMLLets. Used to insert an iframe into the final output.' ); $wgHooks['OutputPageBeforeHTML'][] = array('boilerplateselection'); # If you add a new project to pdp++ and want to see its documentation, add it to this list $subdirs = array('bp','cs','leabra','pdp','so','ta'); $status = false; global $wgTitle; foreach ($subdirs as $subdir) { $this_file = '/usr/local/gendoc/'.$subdir.'/'.$wgTitle.html; print $this_file; if(file_exists($this_file)) { $status = true; } } if ($status){ boilerplateselection(); } function boilerplateselection(&$parserOutput) { #$articleTitle = $editpage->mArticle->mTitle->getText(); #$articleTitle = $parserOutput->mTitle->getText(); global $wgTitle; $articleTitle = $wgTitle->getText(); $dir = "http://grey.colorado.edu/gendoc/"; $output = ""; $wgExtPatchOutputTable = array( '
' => '
'.$output );
$wgExtPatchOutput = new ExtPatchOutput();
$wgHooks['OutputPageBeforeHTML'][] = array( &$wgExtPatchOutput,"onOutputPageBeforeHTML" );
return true;
}
class ExtPatchOutput
{
public static $mVersion = "0.1";
public function onOutputPageBeforeHTML( &$out, &$text ) {
global $wgExtPatchOutputTable;
foreach( $wgExtPatchOutputTable as $from => $to )
$text =& str_replace( $from, $to, $text );
return true;
}
}
?>