Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -996,7 +996,54 @@ |
997 | 997 | $this->mOutput = $output; |
998 | 998 | $this->mFullTitle = $output->getTitle(); |
999 | 999 | } |
| 1000 | + |
1000 | 1001 | /** |
| 1002 | + * Get the WebRequest being used for this instance |
| 1003 | + * |
| 1004 | + * @return WebRequest |
| 1005 | + */ |
| 1006 | + public function getRequest() { |
| 1007 | + if ( !isset($this->mRequest) ) { |
| 1008 | + wfDebug( __METHOD__ . " called and \$mRequest is null. Return \$wgRequest for sanity\n" ); |
| 1009 | + global $wgRequest; |
| 1010 | + return $wgRequest; |
| 1011 | + } |
| 1012 | + return $this->mRequest; |
| 1013 | + } |
| 1014 | + |
| 1015 | + /** |
| 1016 | + * Get the OutputPage being used for this instance |
| 1017 | + * |
| 1018 | + * @return OutputPage |
| 1019 | + */ |
| 1020 | + public function getOutput() { |
| 1021 | + if ( !isset($this->mOutput) ) { |
| 1022 | + wfDebug( __METHOD__ . " called and \$mOutput is null. Return \$wgOut for sanity\n" ); |
| 1023 | + global $wgOut; |
| 1024 | + return $wgOut; |
| 1025 | + } |
| 1026 | + return $this->mOutput; |
| 1027 | + } |
| 1028 | + |
| 1029 | + /** |
| 1030 | + * Shortcut to get the skin being used for this instance |
| 1031 | + * |
| 1032 | + * @return User |
| 1033 | + */ |
| 1034 | + public function getUser() { |
| 1035 | + return $this->getOutput()->getUser(); |
| 1036 | + } |
| 1037 | + |
| 1038 | + /** |
| 1039 | + * Shortcut to get the skin being used for this instance |
| 1040 | + * |
| 1041 | + * @return Skin |
| 1042 | + */ |
| 1043 | + public function getSkin() { |
| 1044 | + return $this->getOutput()->getSkin(); |
| 1045 | + } |
| 1046 | + |
| 1047 | + /** |
1001 | 1048 | * Wrapper around wfMessage that sets the current context. Currently this |
1002 | 1049 | * is only the title. |
1003 | 1050 | * |