All pastes #621569 Raw Edit

Someone

public php v1 · immutable
·published 2007-07-16 08:20 UTC
rendered paste body
<?php#     get out if not part of mediawiki ..if( !defined( 'MEDIAWIKI' ) ) {  echo( "This file is part of an extension to the MediaWiki software and cannot be used standalone.\n" );  die( true );}$wgExtensionCredits['other'][] = array(                                       'name' => '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;  $dir = "http://grey.colorado.edu/gendoc/";  $output = "<iframe src=\"".$dir.$name.".html\" width=\"100%\" name=\"".$name."\" style=\"frameborder:0;marginwidth:0;marginheight:0;scrolling:no;\" title=\"".$dir.$name."\">[Your user agent does not support frames or is currently configured not to display fra\mes. However, you may visit <a href=\"".$dir.$name."\">The original page</a></iframe>";  $wgExtPatchOutputTable = array( '</p><p><br />' => '</p><p><br />'.$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;  }}?>