r44189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44188‎ | r44189 | r44190 >
Date:21:06, 3 December 2008
Author:ialex
Status:ok
Tags:
Comment:
* rm useless ConfigurationPagerFiles::getSearchForm()
* added an interface for for pagers
Modified paths:
  • /trunk/extensions/Configure/Configure.pager-db.php (modified) (history)
  • /trunk/extensions/Configure/Configure.pager-files.php (modified) (history)
  • /trunk/extensions/Configure/Configure.pager.php (added) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.pager.php
@@ -0,0 +1,37 @@
 2+<?php
 3+
 4+/**
 5+ * Interface for pagers used to list versions at Special:ViewConfig
 6+ *
 7+ * @ingroup Extensions
 8+ * @author Alexandre Emsenhuber
 9+ */
 10+interface ConfigurationPager extends Pager {
 11+
 12+ /**
 13+ * Set the wiki to get versions or false for all wikis
 14+ *
 15+ * @param $wiki String or false
 16+ */
 17+ public function setWiki( $wiki );
 18+
 19+ /**
 20+ * Get the number of rows in the pager
 21+ *
 22+ * @return Integer
 23+ */
 24+ public function getNumRows();
 25+
 26+ /**
 27+ * Used to set a callback function to format the rows, this is generally
 28+ * SpecialViewConfig::formatVersionRow(). The callback needs as first param
 29+ * an array with the following keys set:
 30+ * - timestamp: version's timestamp
 31+ * - wikis: array of wikis in the version
 32+ * - count: a counter, starting at 1 for the top (newer) row
 33+ * - user_name: Name of the user who made the version
 34+ * - user_wiki: Wiki in which the user made the version
 35+ * - reason: revision's comment
 36+ */
 37+ public function setFormatCallback( $callback );
 38+}
Property changes on: trunk/extensions/Configure/Configure.pager.php
___________________________________________________________________
Added: svn:eol-style
139 + native
Index: trunk/extensions/Configure/Configure.php
@@ -235,6 +235,7 @@
236236 $wgAutoloadClasses['HistoryConfigurationDiff'] = $dir . 'Configure.diff.php';
237237
238238 # Pager stuff
 239+$wgAutoloadClasses['ConfigurationPager'] = $dir . 'Configure.pager.php';
239240 $wgAutoloadClasses['ConfigurationPagerDb'] = $dir . 'Configure.pager-db.php';
240241 $wgAutoloadClasses['ConfigurationPagerFiles'] = $dir . 'Configure.pager-files.php';
241242
Index: trunk/extensions/Configure/Configure.pager-db.php
@@ -7,7 +7,7 @@
88 * @ingroup Extensions
99 * @author Alexandre Emsenhuber
1010 */
11 -class ConfigurationPagerDb extends ReverseChronologicalPager {
 11+class ConfigurationPagerDb extends ReverseChronologicalPager implements ConfigurationPager {
1212 protected $mHandler, $mCallback, $mCounter = 0, $mWiki = false;
1313
1414 function __construct( ConfigureHandlerDb $handler ) {
Index: trunk/extensions/Configure/Configure.pager-files.php
@@ -6,7 +6,7 @@
77 * @ingroup Extensions
88 * @author Alexandre Emsenhuber
99 */
10 -class ConfigurationPagerFiles implements Pager {
 10+class ConfigurationPagerFiles implements ConfigurationPager {
1111 protected $mHandler, $mCallback, $mWiki = false;
1212
1313 function __construct( ConfigureHandler $handler ) {
@@ -57,10 +57,6 @@
5858 return '';
5959 }
6060
61 - function getSearchForm() {
62 - return '';
63 - }
64 -
6561 function setFormatCallback( $callback ) {
6662 $this->mCallback = $callback;
6763 }

Status & tagging log