* (bug 6844) Use <ins> and <del> tags to emphase the differences
* (bug 6684) Fix improper javascript array iteration
* (bug 4347) use MailAddress object for reply-to
+* Add AlphabeticPager abstract class
+* Use faster AlphabeticPager for Special:Categories
== Languages updated ==
'AjaxDispatcher' => 'includes/AjaxDispatcher.php',
'AjaxCachePolicy' => 'includes/AjaxFunctions.php',
'AjaxResponse' => 'includes/AjaxResponse.php',
+ 'AlphabeticPager' => 'includes/Pager.php',
'Article' => 'includes/Article.php',
'AuthPlugin' => 'includes/AuthPlugin.php',
'BagOStuff' => 'includes/BagOStuff.php',
'IPBlockForm' => 'includes/SpecialBlockip.php',
'SpecialBookSources' => 'includes/SpecialBooksources.php',
'BrokenRedirectsPage' => 'includes/SpecialBrokenRedirects.php',
- 'CategoriesPage' => 'includes/SpecialCategories.php',
'EmailConfirmation' => 'includes/SpecialConfirmemail.php',
'ContributionsPage' => 'includes/SpecialContributions.php',
'DeadendPagesPage' => 'includes/SpecialDeadendpages.php',
abstract function getIndexField();
}
+
+/**
+ * IndexPager with an alphabetic list and a formatted navigation bar
+*/
+abstract class AlphabeticPager extends IndexPager {
+ public $mDefaultDirection = false;
+
+ function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Shamelessly stolen bits from ReverseChronologicalPager, d
+ * didn't want to do class magic as may be still revamped
+ */
+ function getNavigationBar() {
+ global $wgLang;
+
+ $linkTexts = array(
+ 'prev' => wfMsgHtml( "prevn", $this->mLimit ),
+ 'next' => wfMsgHtml( 'nextn', $this->mLimit ),
+ 'first' => wfMsgHtml('first'), /* Introduced the message */
+ 'last' => wfMsgHtml( 'last' )
+ );
+
+ $pagingLinks = $this->getPagingLinks( $linkTexts );
+ $limitLinks = $this->getLimitLinks();
+ $limits = implode( ' | ', $limitLinks );
+
+ $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " . wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
+ return $this->mNavigationBar;
+
+ }
+}
+
/**
* IndexPager with a formatted navigation bar
*/
* @addtogroup SpecialPage
*/
-/**
- *
- * @addtogroup SpecialPage
- */
-class CategoriesPage extends QueryPage {
-
- function getName() {
- return "Categories";
- }
-
- function isExpensive() {
- return false;
- }
-
- function isSyndicated() { return false; }
+function wfSpecialCategories() {
+ global $wgOut;
+
+ $cap = new CategoryPager();
+ $wgOut->addHTML(
+ wfMsgWikiHtml( 'categoriespagetext' ) .
+ $cap->getNavigationBar()
+ . '<ul>' . $cap->getBody() . '</ul>' .
+ $cap->getNavigationBar()
+ );
+}
- function getPageHeader() {
- return wfMsgWikiHtml( 'categoriespagetext' );
+class CategoryPager extends AlphabeticPager {
+ function getQueryInfo() {
+ return array(
+ 'tables' => array('categorylinks'),
+ 'fields' => array('cl_to','count(*) count'),
+ 'options' => array('GROUP BY' => 'cl_to')
+ );
}
- function getSQL() {
- $NScat = NS_CATEGORY;
- $dbr = wfGetDB( DB_SLAVE );
- $categorylinks = $dbr->tableName( 'categorylinks' );
- $implicit_groupby = $dbr->implicitGroupby() ? '1' : 'cl_to';
- $s= "SELECT 'Categories' as type,
- {$NScat} as namespace,
- cl_to as title,
- $implicit_groupby as value,
- COUNT(*) as count
- FROM $categorylinks
- GROUP BY 1,2,3,4";
- return $s;
+ function getIndexField() {
+ return "cl_to";
}
-
- function sortDescending() {
- return false;
- }
-
- function formatResult( $skin, $result ) {
+
+ function formatRow($result) {
global $wgLang;
- $title = Title::makeTitle( NS_CATEGORY, $result->title );
- $plink = $skin->makeLinkObj( $title, $title->getText() );
- $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
- $wgLang->formatNum( $result->count ) );
- return wfSpecialList($plink, $nlinks);
+
+ $title = Title::makeTitle( NS_CATEGORY, $result->cl_to );
+ return (
+ '<li>' .
+ $this->getSkin()->makeLinkObj( $title, $title->getText() )
+ . ' ' .
+ $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
+ $wgLang->formatNum( $result->count ) )
+ .
+ "</li>\n" );
}
}
-/**
- *
- */
-function wfSpecialCategories() {
- list( $limit, $offset ) = wfCheckLimits();
-
- $cap = new CategoriesPage();
-
- return $cap->doQuery( $offset, $limit );
-}
-
?>
'currentrevisionlink' => 'Current revision',
'cur' => 'cur',
'next' => 'next',
+'first' => 'first',
'last' => 'last',
'orig' => 'orig',
'histlegend' => 'Diff selection: mark the radio boxes of the versions to compare and hit enter or the button at the bottom.<br />