r106602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106601‎ | r106602 | r106603 >
Date:21:37, 18 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
work on pager
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitutions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialInstitutions.php
@@ -100,7 +100,7 @@
101101
102102 $out->addHTML( Xml::inputLabel( wfMsg( 'ep-institutions-newname' ), 'newname', 'newname' ) );
103103
104 - $out->addHTML( Html::input(
 104+ $out->addHTML( ' ' . Html::input(
105105 'addneworg',
106106 wfMsg( 'ep-institutions-add' ),
107107 'submit'
Index: trunk/extensions/EducationProgram/includes/EPPager.php
@@ -168,9 +168,7 @@
169169 $c = $this->className;
170170
171171 foreach ( $fields as $fieldName ) {
172 - $headers[$c::getPrefixedField( $fieldName )] = wfMsg(
173 - 'educationprogram-pager-' . strtolower( $c ) . '-' . str_replace( '_', '-', $fieldName )
174 - );
 172+ $headers[$c::getPrefixedField( $fieldName )] = $this->getMsg( 'header-' . $fieldName );
175173 }
176174
177175 return $headers;
@@ -235,6 +233,8 @@
236234 break;
237235 }
238236
 237+ $control = ' ' . $this->getMsg( 'filter-' . $optionName ) . ' ' . $control;
 238+
239239 $controls[] = $control;
240240 }
241241
@@ -242,11 +242,11 @@
243243
244244 return
245245 '<fieldset>' .
246 - '<legend>' . wfMsgHtml( 'reviews-reviews-showonly' ) . '</legend>' .
 246+ '<legend>' . wfMsgHtml( 'educationprogram-pager-showonly' ) . '</legend>' .
247247 '<form method="post" action="' . htmlspecialchars( $GLOBALS['wgScript'] . '?title=' . $title ) . '">' .
248248 Html::hidden( 'title', $title ) .
249249 implode( '', $controls ) .
250 - '<input type="submit" value="' . wfMsgHtml( 'reviews-reviews-go' ) . '">' .
 250+ '&#160;<input type="submit" value="' . wfMsgHtml( 'reviews-reviews-go' ) . '">' .
251251 '</form>' .
252252 '</fieldset>';
253253 }
@@ -279,5 +279,19 @@
280280
281281 return $changed;
282282 }
 283+
 284+ /**
 285+ * Takes a message key and prefixes it with the extension name and name of the pager,
 286+ * feeds it to wfMsg, and returns it.
 287+ *
 288+ * @since 0.1
 289+ *
 290+ * @param string $messageKey
 291+ *
 292+ * @return string
 293+ */
 294+ protected function getMsg( $messageKey ) {
 295+ return wfMsg( strtolower( $this->className ) . 'pager-' . str_replace( '_', '-', $messageKey ) );
 296+ }
283297
284298 }
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -64,10 +64,14 @@
6565 'ep-institutions-newname' => 'Institution name:',
6666 'ep-institutions-add' => 'Add institution',
6767
 68+ // Pager
 69+ 'educationprogram-pager-showonly' => 'Show only these items',
 70+
6871 // Org pager
69 - 'educationprogram-pager-eporg-name' => 'Name',
70 - 'educationprogram-pager-eporg-city' => 'City',
71 - 'educationprogram-pager-eporg-country' => 'Country',
 72+ 'eporgpager-header-name' => 'Name',
 73+ 'eporgpager-header-city' => 'City',
 74+ 'eporgpager-header-country' => 'Country',
 75+ 'eporgpager-filter-country' => 'Country',
7276
7377 // Special:EditInstitution
7478 'editinstitution-text' => 'Enter the institution details below and click submit to save your changes.',

Status & tagging log