'Preferences' => 'SpecialPreferences',
'Contributions' => 'SpecialContributions',
'Listgrouprights' => 'SpecialListGroupRights',
- 'Listusers' => array( 'SpecialPage', 'Listusers' ),
+ 'Listusers' => 'SpecialListusers',
'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
'Activeusers' => 'SpecialActiveUsers',
'EditWatchlist' => 'SpecialEditWatchlist',
# Recent changes and logs
- 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
+ 'Newimages' => 'SpecialNewFiles',
'Log' => 'SpecialLog',
'Watchlist' => 'SpecialWatchlist',
'Newpages' => 'SpecialNewpages',
'Tags' => 'SpecialTags',
# Media reports and uploads
- 'Listfiles' => array( 'SpecialPage', 'Listfiles' ),
+ 'Listfiles' => 'SpecialListFiles',
'Filepath' => 'SpecialFilepath',
'MIMEsearch' => 'MIMEsearchPage',
'FileDuplicateSearch' => 'FileDuplicateSearchPage',
* @return String: HTML fragment
*/
static function capturePath( &$title ) {
- global $wgOut, $wgTitle;
+ global $wgOut, $wgTitle, $wgUser;
$oldTitle = $wgTitle;
$oldOut = $wgOut;
$wgOut = new OutputPage;
$wgOut->setTitle( $title );
+ $wgOut->setUser( $wgUser ); # for now, there may be a better idea in the future
$ret = SpecialPage::executePath( $title, true );
if ( $ret === true ) {
$this->mOutput = $output;
$this->mFullTitle = $output->getTitle();
}
+
+ /**
+ * Get the WebRequest being used for this instance
+ *
+ * @return WebRequest
+ */
+ public function getRequest() {
+ if ( !isset($this->mRequest) ) {
+ wfDebug( __METHOD__ . " called and \$mRequest is null. Return \$wgRequest for sanity\n" );
+ global $wgRequest;
+ return $wgRequest;
+ }
+ return $this->mRequest;
+ }
+
+ /**
+ * Get the OutputPage being used for this instance
+ *
+ * @return OutputPage
+ */
+ public function getOutput() {
+ if ( !isset($this->mOutput) ) {
+ wfDebug( __METHOD__ . " called and \$mOutput is null. Return \$wgOut for sanity\n" );
+ global $wgOut;
+ return $wgOut;
+ }
+ return $this->mOutput;
+ }
+
+ /**
+ * Shortcut to get the skin being used for this instance
+ *
+ * @return User
+ */
+ public function getUser() {
+ return $this->getOutput()->getUser();
+ }
+
+ /**
+ * Shortcut to get the skin being used for this instance
+ *
+ * @return Skin
+ */
+ public function getSkin() {
+ return $this->getOutput()->getSkin();
+ }
+
/**
* Wrapper around wfMessage that sets the current context. Currently this
* is only the title.