Index: branches/robchurch/reports/includes/reports/Report.php |
— | — | @@ -80,6 +80,18 @@ |
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
| 84 | + * Is there a more appropriate title to show when |
| 85 | + * a particular namespace is selected? Return the |
| 86 | + * message name here |
| 87 | + * |
| 88 | + * @param int $namespace |
| 89 | + * @return string |
| 90 | + */ |
| 91 | + public function getNamespaceTitleVariant( $namespace ) { |
| 92 | + return false; |
| 93 | + } |
| 94 | + |
| 95 | + /** |
84 | 96 | * Return base SQL for the report |
85 | 97 | * |
86 | 98 | * @param Database $dbr Database object being queried |
— | — | @@ -169,6 +181,12 @@ |
170 | 182 | public function execute( $par = false ) { |
171 | 183 | global $wgOut, $wgRequest, $wgLang; |
172 | 184 | $this->setHeaders(); |
| 185 | + # Per-namespace title variants |
| 186 | + if( ( $ns = $wgRequest->getVal( 'namespace', false ) ) !== false ) { |
| 187 | + if( ( $msg = $this->getNamespaceTitleVariant( $ns ) ) !== false ) |
| 188 | + $wgOut->setPageTitle( wfMsg( $msg ) ); |
| 189 | + } |
| 190 | + # Cache information, etc. |
173 | 191 | $pager = $this->getPager(); |
174 | 192 | if( $this->isDisabled() ) { |
175 | 193 | $wgOut->addHtml( '<div class="mw-report-disabled">' . wfMsgExt( 'report-disabled', 'parse' ) . '</div>' ); |
Index: branches/robchurch/reports/includes/reports/UncategorisedPagesReport.php |
— | — | @@ -48,6 +48,27 @@ |
49 | 49 | NS_CATEGORY |
50 | 50 | ); |
51 | 51 | } |
| 52 | + |
| 53 | + /** |
| 54 | + * Is there a more appropriate title to show when |
| 55 | + * a particular namespace is selected? Return the |
| 56 | + * message name here |
| 57 | + * |
| 58 | + * @param int $namespace |
| 59 | + * @return string |
| 60 | + */ |
| 61 | + public function getNamespaceTitleVariant( $namespace ) { |
| 62 | + switch( $namespace ) { |
| 63 | + case NS_IMAGE: |
| 64 | + return 'uncategorizedimages'; |
| 65 | + case NS_TEMPLATE: |
| 66 | + return 'uncategorizedtemplates'; |
| 67 | + case NS_CATEGORY: |
| 68 | + return 'uncategorizedcategories'; |
| 69 | + default: |
| 70 | + return false; |
| 71 | + } |
| 72 | + } |
52 | 73 | |
53 | 74 | /** |
54 | 75 | * Return base SQL for the report |