Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1059,12 +1059,25 @@ |
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | /** |
1063 | | - * return from error messages or notes |
1064 | | - * @param $unused No longer used |
1065 | | - * @param $returnto page title to return to. Default is Main Page. |
| 1063 | + * Add a "return to" link pointing to a specified title |
| 1064 | + * |
| 1065 | + * @param Title $title Title to link |
1066 | 1066 | */ |
| 1067 | + public function addReturnTo( $title ) { |
| 1068 | + global $wgUser; |
| 1069 | + $link = wfMsg( 'returnto', $wgUser->getSkin()->makeLinkObj( $title ) ); |
| 1070 | + $this->addHtml( "<p>{$link}</p>\n" ); |
| 1071 | + } |
| 1072 | + |
| 1073 | + /** |
| 1074 | + * Add a "return to" link pointing to a specified title, |
| 1075 | + * or the title indicated in the request, or else the main page |
| 1076 | + * |
| 1077 | + * @param null $unused No longer used |
| 1078 | + * @param Title $returnto Title to return to |
| 1079 | + */ |
1067 | 1080 | public function returnToMain( $unused = null, $returnto = NULL ) { |
1068 | | - global $wgUser, $wgOut, $wgRequest; |
| 1081 | + global $wgRequest; |
1069 | 1082 | |
1070 | 1083 | if ( $returnto == NULL ) { |
1071 | 1084 | $returnto = $wgRequest->getText( 'returnto' ); |
— | — | @@ -1083,11 +1096,7 @@ |
1084 | 1097 | $titleObj = Title::newMainPage(); |
1085 | 1098 | } |
1086 | 1099 | |
1087 | | - $sk = $wgUser->getSkin(); |
1088 | | - $link = $sk->makeLinkObj( $titleObj, '' ); |
1089 | | - |
1090 | | - $r = wfMsg( 'returnto', $link ); |
1091 | | - $wgOut->addHTML( "\n<p>$r</p>\n" ); |
| 1100 | + $this->addReturnTo( $titleObj ); |
1092 | 1101 | } |
1093 | 1102 | |
1094 | 1103 | /** |