SpecialUncategorizedImages.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Implements Special:Uncategorizedimages
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. * http://www.gnu.org/copyleft/gpl.html
  19. *
  20. * @file
  21. * @ingroup SpecialPage
  22. * @author Rob Church <robchur@gmail.com>
  23. */
  24. /**
  25. * Special page lists images which haven't been categorised
  26. *
  27. * @ingroup SpecialPage
  28. * @todo FIXME: Use an instance of UncategorizedPagesPage or something
  29. */
  30. class SpecialUncategorizedImages extends ImageQueryPage {
  31. function __construct( $name = 'Uncategorizedimages' ) {
  32. parent::__construct( $name );
  33. $this->addHelpLink( 'Help:Categories' );
  34. }
  35. function sortDescending() {
  36. return false;
  37. }
  38. function isExpensive() {
  39. return true;
  40. }
  41. function isSyndicated() {
  42. return false;
  43. }
  44. function getOrderFields() {
  45. return [ 'title' ];
  46. }
  47. function getQueryInfo() {
  48. return [
  49. 'tables' => [ 'page', 'categorylinks' ],
  50. 'fields' => [
  51. 'namespace' => 'page_namespace',
  52. 'title' => 'page_title',
  53. ],
  54. 'conds' => [
  55. 'cl_from IS NULL',
  56. 'page_namespace' => NS_FILE,
  57. 'page_is_redirect' => 0,
  58. ],
  59. 'join_conds' => [
  60. 'categorylinks' => [
  61. 'LEFT JOIN',
  62. 'cl_from=page_id',
  63. ],
  64. ],
  65. ];
  66. }
  67. protected function getGroupName() {
  68. return 'maintenance';
  69. }
  70. }