/**
* Just like executePath() but will override global variables and execute
- * the page in "inclusion" mode. Returns true if the excution was successful
- * or false if there was no such special page, or a title object if it was
- * a redirect.
+ * the page in "inclusion" mode. Returns true if the execution was
+ * successful or false if there was no such special page, or a title object
+ * if it was a redirect.
*
* Also saves the current $wgTitle, $wgOut, $wgRequest, $wgUser and $wgLang
* variables so that the special page will get the context it'd expect on a
// The useful part
$ret = self::executePath( $title, $context, true );
- // And restore that globals
+ // And restore the old globals
$wgTitle = $oldTitle;
$wgOut = $oldOut;
$wgRequest = $oldRequest;
&& $this->mOptions->getAllowSpecialInclusion()
&& $this->ot['html'] )
{
+ // Pass the template arguments as URL parameters.
+ // "uselang" will have no effect since the Language object
+ // is forced to the one defined in ParserOptions.
$pageArgs = array();
for ( $i = 0; $i < $args->getLength(); $i++ ) {
$bits = $args->item( $i )->splitArg();
$pageArgs[$name] = $value;
}
}
+
+ // Create a new context to execute the special page
$context = new RequestContext;
$context->setTitle( $title );
$context->setRequest( new FauxRequest( $pageArgs ) );