X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FQueryPage.php;h=cf0a644671782e49118593b3a14159d151286cc4;hb=e9d4d06276245ab4e4b3c8a256177e7b1a8afcc7;hp=bb6a0c3ef0ba53e43b53e1c28d503694b104270b;hpb=d1add38536a928b6c8e0e75e2e50c89b974fe278;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/QueryPage.php b/includes/QueryPage.php index bb6a0c3ef0..cf0a644671 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -21,57 +21,6 @@ * @ingroup SpecialPage */ -/** - * List of query page classes and their associated special pages, - * for periodic updates. - * - * DO NOT CHANGE THIS LIST without testing that - * maintenance/updateSpecialPages.php still works. - */ -global $wgQueryPages; // not redundant -$wgQueryPages = array( -// QueryPage subclass, Special page name, Limit (false for none, none for the default) -// ---------------------------------------------------------------------------- - array( 'AncientPagesPage', 'Ancientpages' ), - array( 'BrokenRedirectsPage', 'BrokenRedirects' ), - array( 'DeadendPagesPage', 'Deadendpages' ), - array( 'DoubleRedirectsPage', 'DoubleRedirects' ), - array( 'FileDuplicateSearchPage', 'FileDuplicateSearch' ), - array( 'LinkSearchPage', 'LinkSearch' ), - array( 'ListredirectsPage', 'Listredirects' ), - array( 'LonelyPagesPage', 'Lonelypages' ), - array( 'LongPagesPage', 'Longpages' ), - array( 'MIMEsearchPage', 'MIMEsearch' ), - array( 'MostcategoriesPage', 'Mostcategories' ), - array( 'MostimagesPage', 'Mostimages' ), - array( 'MostinterwikisPage', 'Mostinterwikis' ), - array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ), - array( 'MostlinkedtemplatesPage', 'Mostlinkedtemplates' ), - array( 'MostlinkedPage', 'Mostlinked' ), - 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' ), - array( 'WantedFilesPage', 'Wantedfiles' ), - array( 'WantedPagesPage', 'Wantedpages' ), - array( 'WantedTemplatesPage', 'Wantedtemplates' ), - array( 'UnwatchedPagesPage', 'Unwatchedpages' ), - array( 'UnusedtemplatesPage', 'Unusedtemplates' ), - array( 'WithoutInterwikiPage', 'Withoutinterwiki' ), -); -wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) ); - -global $wgDisableCounters; -if ( !$wgDisableCounters ) { - $wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' ); -} - /** * This is a class for doing query pages; since they're almost all the same, * we factor out some of the functionality into a superclass, and let @@ -104,10 +53,69 @@ abstract class QueryPage extends SpecialPage { protected $cachedTimestamp = null; /** - * Wheter to show prev/next links + * Whether to show prev/next links */ protected $shownavigation = true; + /** + * Get a list of query page classes and their associated special pages, + * for periodic updates. + * + * DO NOT CHANGE THIS LIST without testing that + * maintenance/updateSpecialPages.php still works. + * @return array + */ + public static function getPages() { + global $wgDisableCounters; + static $qp = null; + + if ( $qp === null ) { + // QueryPage subclass, Special page name + $qp = array( + array( 'AncientPagesPage', 'Ancientpages' ), + array( 'BrokenRedirectsPage', 'BrokenRedirects' ), + array( 'DeadendPagesPage', 'Deadendpages' ), + array( 'DoubleRedirectsPage', 'DoubleRedirects' ), + array( 'FileDuplicateSearchPage', 'FileDuplicateSearch' ), + array( 'ListDuplicatedFilesPage', 'ListDuplicatedFiles'), + array( 'LinkSearchPage', 'LinkSearch' ), + array( 'ListredirectsPage', 'Listredirects' ), + array( 'LonelyPagesPage', 'Lonelypages' ), + array( 'LongPagesPage', 'Longpages' ), + array( 'MIMEsearchPage', 'MIMEsearch' ), + array( 'MostcategoriesPage', 'Mostcategories' ), + array( 'MostimagesPage', 'Mostimages' ), + array( 'MostinterwikisPage', 'Mostinterwikis' ), + array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ), + array( 'MostlinkedtemplatesPage', 'Mostlinkedtemplates' ), + array( 'MostlinkedPage', 'Mostlinked' ), + 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' ), + array( 'WantedFilesPage', 'Wantedfiles' ), + array( 'WantedPagesPage', 'Wantedpages' ), + array( 'WantedTemplatesPage', 'Wantedtemplates' ), + array( 'UnwatchedPagesPage', 'Unwatchedpages' ), + array( 'UnusedtemplatesPage', 'Unusedtemplates' ), + array( 'WithoutInterwikiPage', 'Withoutinterwiki' ), + ); + wfRunHooks( 'wgQueryPages', array( &$qp ) ); + + if ( !$wgDisableCounters ) { + $qp[] = array( 'PopularPagesPage', 'Popularpages' ); + } + } + + return $qp; + } + /** * A mutator for $this->listoutput; * @@ -351,6 +359,7 @@ abstract class QueryPage extends SpecialPage { /** * Get a DB connection to be used for slow recache queries + * @return DatabaseBase */ function getRecacheDB() { return wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) ); @@ -545,7 +554,7 @@ abstract class QueryPage extends SpecialPage { if ( $this->numRows > 0 ) { $out->addHTML( $this->msg( 'showingresultsinrange' )->numParams( min( $this->numRows, $this->limit ), # do not show the one extra row, if exist - $this->offset + 1, (min( $this->numRows, $this->limit ) + $this->offset) )->parseAsBlock() ); + $this->offset + 1, ( min( $this->numRows, $this->limit ) + $this->offset ) )->parseAsBlock() ); # Disable the "next" link when we reach the end $paging = $this->getLanguage()->viewPrevNext( $this->getPageTitle( $par ), $this->offset, $this->limit, $this->linkParameters(), ( $this->numRows <= $this->limit ) ); @@ -640,7 +649,7 @@ abstract class QueryPage extends SpecialPage { } /** - * @param $offset + * @param int $offset * @return string */ function openList( $offset ) {