Harmageddon has uploaded a new change for review. https://gerrit.wikimedia.org/r/184189
Change subject: Unify Special:UncategorizedPages/Categories/Templates ...................................................................... Unify Special:UncategorizedPages/Categories/Templates Adds a namespace parameter to Special:UncategorizedPages and removes Special:UncategorizedCategories and Special:UncategorizedTemplates. Bug: T14942 Change-Id: Iee110509c3d2743aa198d348dd87f869ba31dc73 --- M autoload.php M includes/specialpage/QueryPage.php M includes/specialpage/SpecialPageFactory.php D includes/specials/SpecialUncategorizedcategories.php M includes/specials/SpecialUncategorizedpages.php D includes/specials/SpecialUncategorizedtemplates.php M maintenance/dictionary/mediawiki.dic 7 files changed, 33 insertions(+), 94 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/89/184189/1 diff --git a/autoload.php b/autoload.php index 674d4b0..e46cd88 100644 --- a/autoload.php +++ b/autoload.php @@ -1204,10 +1204,8 @@ 'UDPTransport' => __DIR__ . '/includes/libs/UDPTransport.php', 'UIDGenerator' => __DIR__ . '/includes/utils/UIDGenerator.php', 'UcdXmlReader' => __DIR__ . '/maintenance/language/generateCollationData.php', - 'UncategorizedCategoriesPage' => __DIR__ . '/includes/specials/SpecialUncategorizedcategories.php', 'UncategorizedImagesPage' => __DIR__ . '/includes/specials/SpecialUncategorizedimages.php', 'UncategorizedPagesPage' => __DIR__ . '/includes/specials/SpecialUncategorizedpages.php', - 'UncategorizedTemplatesPage' => __DIR__ . '/includes/specials/SpecialUncategorizedtemplates.php', 'Undelete' => __DIR__ . '/maintenance/undelete.php', 'UnifiedDiffFormatter' => __DIR__ . '/includes/diff/UnifiedDiffFormatter.php', 'UnlistedSpecialPage' => __DIR__ . '/includes/specialpage/UnlistedSpecialPage.php', diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php index 1ff7e3f..41fc39a 100644 --- a/includes/specialpage/QueryPage.php +++ b/includes/specialpage/QueryPage.php @@ -86,10 +86,8 @@ array( 'MostrevisionsPage', 'Mostrevisions' ), array( 'FewestrevisionsPage', 'Fewestrevisions' ), array( 'ShortPagesPage', 'Shortpages' ), - array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ), array( 'UncategorizedPagesPage', 'Uncategorizedpages' ), array( 'UncategorizedImagesPage', 'Uncategorizedimages' ), - array( 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ), array( 'UnusedCategoriesPage', 'Unusedcategories' ), array( 'UnusedimagesPage', 'Unusedimages' ), array( 'WantedCategoriesPage', 'Wantedcategories' ), diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 175b0cb..b01be9b 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -60,10 +60,8 @@ 'Protectedpages' => 'SpecialProtectedpages', 'Protectedtitles' => 'SpecialProtectedtitles', 'Shortpages' => 'ShortPagesPage', - 'Uncategorizedcategories' => 'UncategorizedCategoriesPage', 'Uncategorizedimages' => 'UncategorizedImagesPage', 'Uncategorizedpages' => 'UncategorizedPagesPage', - 'Uncategorizedtemplates' => 'UncategorizedTemplatesPage', 'Unusedcategories' => 'UnusedCategoriesPage', 'Unusedimages' => 'UnusedimagesPage', 'Unusedtemplates' => 'UnusedtemplatesPage', diff --git a/includes/specials/SpecialUncategorizedcategories.php b/includes/specials/SpecialUncategorizedcategories.php deleted file mode 100644 index 1cc40a9..0000000 --- a/includes/specials/SpecialUncategorizedcategories.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Implements Special:Uncategorizedcategories - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup SpecialPage - */ - -/** - * A special page that lists uncategorized categories - * - * @ingroup SpecialPage - */ -class UncategorizedCategoriesPage extends UncategorizedPagesPage { - function __construct( $name = 'Uncategorizedcategories' ) { - parent::__construct( $name ); - $this->requestedNamespace = NS_CATEGORY; - } - - /** - * Formats the result - * @param Skin $skin The current skin - * @param object $result The query result - * @return string The category link - */ - function formatResult( $skin, $result ) { - $title = Title::makeTitle( NS_CATEGORY, $result->title ); - $text = $title->getText(); - - return Linker::linkKnown( $title, htmlspecialchars( $text ) ); - } -} diff --git a/includes/specials/SpecialUncategorizedpages.php b/includes/specials/SpecialUncategorizedpages.php index 8251d5b..b5388a4 100644 --- a/includes/specials/SpecialUncategorizedpages.php +++ b/includes/specials/SpecialUncategorizedpages.php @@ -28,10 +28,13 @@ * @todo FIXME: Make $requestedNamespace selectable, unify all subclasses into one */ class UncategorizedPagesPage extends PageQueryPage { - protected $requestedNamespace = false; + protected $requestedNamespace = null; function __construct( $name = 'Uncategorizedpages' ) { parent::__construct( $name ); + $request = $this->getRequest(); + + $this->requestedNamespace = $request->getIntOrNull( 'namespace' ); } function sortDescending() { @@ -58,7 +61,7 @@ // otherwise, page_namespace is requestedNamespace 'conds' => array( 'cl_from IS NULL', - 'page_namespace' => $this->requestedNamespace !== false + 'page_namespace' => $this->requestedNamespace !== null ? $this->requestedNamespace : MWNamespace::getContentNamespaces(), 'page_is_redirect' => 0 @@ -72,7 +75,7 @@ function getOrderFields() { // For some crazy reason ordering by a constant // causes a filesort - if ( $this->requestedNamespace === false && count( MWNamespace::getContentNamespaces() ) > 1 ) { + if ( $this->requestedNamespace === null && count( MWNamespace::getContentNamespaces() ) > 1 ) { return array( 'page_namespace', 'page_title' ); } @@ -82,4 +85,31 @@ protected function getGroupName() { return 'maintenance'; } + + function getPageHeader() { + $fields = array( + 'namespace' => array( + 'name' => 'namespace', + 'type' => 'namespaceselect', + 'default' => $this->requestedNamespace === null ? 0 : $this->requestedNamespace, + 'label-message' => 'namespace' + ), + ); + $form = new HTMLForm($fields, $this->getContext()); + + $label = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ); + $field = Html::namespaceSelector( + array( 'selected' => $this->requestedNamespace ), + array( 'name' => 'namespace', 'id' => 'namespace' ) + ); + $submit = Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ); + + //$form = $label . $field . $submit; + $form->setMethod( 'get' ); + $form->setWrapperLegendMsg( 'uncategorizedpages' ); + $form->prepareForm(); + $form->setSubmitText($this->msg( 'allpagessubmit' )->text()); + + return $form->getHTML(''); + } } diff --git a/includes/specials/SpecialUncategorizedtemplates.php b/includes/specials/SpecialUncategorizedtemplates.php deleted file mode 100644 index af038fa..0000000 --- a/includes/specials/SpecialUncategorizedtemplates.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Implements Special:Uncategorizedtemplates - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup SpecialPage - * @author Rob Church <robc...@gmail.com> - */ - -/** - * Special page lists all uncategorised pages in the - * template namespace - * - * @ingroup SpecialPage - */ -class UncategorizedTemplatesPage extends UncategorizedPagesPage { - public function __construct( $name = 'Uncategorizedtemplates' ) { - parent::__construct( $name ); - $this->requestedNamespace = NS_TEMPLATE; - } -} diff --git a/maintenance/dictionary/mediawiki.dic b/maintenance/dictionary/mediawiki.dic index dd27c8c..651ff23 100644 --- a/maintenance/dictionary/mediawiki.dic +++ b/maintenance/dictionary/mediawiki.dic @@ -301,10 +301,8 @@ Ucirc Ugrave Unblock -Uncategorizedcategories Uncategorizedimages Uncategorizedpages -Uncategorizedtemplates Undelete Unusedcategories Unusedimages -- To view, visit https://gerrit.wikimedia.org/r/184189 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee110509c3d2743aa198d348dd87f869ba31dc73 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Harmageddon <harmageddo...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits