r62493 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62492‎ | r62493 | r62494 >
Date:04:37, 15 February 2010
Author:juliano
Status:deferred
Tags:
Comment:
Convert old navigation bars.
Modified paths:
  • /trunk/extensions/Wikilog/SpecialWikilog.php (modified) (history)
  • /trunk/extensions/Wikilog/Wikilog.i18n.php (modified) (history)
  • /trunk/extensions/Wikilog/WikilogDefaultSettings.php (modified) (history)
  • /trunk/extensions/Wikilog/WikilogMainPage.php (modified) (history)
  • /trunk/extensions/Wikilog/WikilogPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikilog/SpecialWikilog.php
@@ -129,7 +129,6 @@
130130 */
131131 public function webOutput( FormOptions $opts ) {
132132 global $wgRequest, $wgOut, $wgMimeType, $wgTitle, $wgParser;
133 - global $wgWikilogNavTop, $wgWikilogNavBottom;
134133
135134 # Set page title, html title, nofollow, noindex, etc...
136135 $this->setHeaders();
@@ -179,10 +178,7 @@
180179 $body .= $pager->getBody();
181180
182181 # Add navigation bars.
183 - if ( $wgWikilogNavTop )
184 - $body = $pager->getNavigationBar( 'wl-navbar-top' ) . $body;
185 - if ( $wgWikilogNavBottom )
186 - $body = $body . $pager->getNavigationBar( 'wl-navbar-bottom' );
 182+ $body .= $pager->getNavigationBar();
187183 }
188184
189185 # Output.
Index: trunk/extensions/Wikilog/WikilogMainPage.php
@@ -60,7 +60,6 @@
6161 */
6262 public function view() {
6363 global $wgRequest, $wgOut, $wgMimeType;
64 - global $wgWikilogNavTop, $wgWikilogNavBottom;
6564
6665 $query = new WikilogItemQuery( $this->mTitle );
6766 $query->setPubStatus( $wgRequest->getVal( 'show' ) );
@@ -98,8 +97,7 @@
9998
10099 # Display list of wikilog posts.
101100 $body = $pager->getBody();
102 - if ( $wgWikilogNavTop ) $body = $pager->getNavigationBar( 'wl-navbar-top' ) . $body;
103 - if ( $wgWikilogNavBottom ) $body = $body . $pager->getNavigationBar( 'wl-navbar-bottom' );
 101+ $body .= $pager->getNavigationBar();
104102 $wgOut->addHTML( Xml::openElement( 'div', array( 'class' => 'wl-wrapper' ) ) );
105103 $wgOut->addHTML( $body );
106104 $wgOut->addHTML( Xml::closeElement( 'div' ) );
Index: trunk/extensions/Wikilog/WikilogPager.php
@@ -34,7 +34,7 @@
3535 interface WikilogPager
3636 {
3737 function including( $x = null );
38 - function getNavigationBar( $class = 'wl-navbar-any' );
 38+ function getNavigationBar();
3939 }
4040
4141 /**
@@ -126,34 +126,12 @@
127127 return '<div class="wl-empty">' . wfMsgExt( 'wikilog-pager-empty', array( 'parsemag' ) ) . "</div>";
128128 }
129129
130 - function getNavigationBar( $class = 'wl-navbar-any' ) {
131 - if ( !isset( $this->mNavigationBar[$class] ) ) {
132 - global $wgLang;
133 -
134 - $nicenumber = $wgLang->formatNum( $this->mLimit );
135 - $linkTexts = array(
136 - 'prev' => wfMsgExt( 'wikilog-pager-newer-n', array( 'parsemag' ), $nicenumber ),
137 - 'next' => wfMsgExt( 'wikilog-pager-older-n', array( 'parsemag' ), $nicenumber ),
138 - 'first' => wfMsgHtml( 'wikilog-pager-newest' ),
139 - 'last' => wfMsgHtml( 'wikilog-pager-oldest' )
140 - );
141 - $pagingLinks = $this->getPagingLinks( $linkTexts );
142 - $limitLinks = $this->getLimitLinks();
143 -
144 - $limits = $wgLang->pipeList( $limitLinks );
145 - $classes = implode( ' ', array( 'wl-navbar', $class ) );
146 -
147 - $this->mNavigationBar[$class] = wfMsgExt( 'wikilog-navigation-bar',
148 - array( 'parsemag' ),
149 - /* $1 */ $pagingLinks['first'],
150 - /* $2 */ $pagingLinks['prev'],
151 - /* $3 */ $pagingLinks['next'],
152 - /* $4 */ $pagingLinks['last'],
153 - /* $5 */ $limits,
154 - /* $6 */ $classes
155 - );
 130+ function getNavigationBar() {
 131+ if ( !isset( $this->mNavigationBar ) ) {
 132+ $navbar = new WikilogNavbar( $this, 'chrono-rev' );
 133+ $this->mNavigationBar = $navbar->getNavigationBar( $this->mLimit );
156134 }
157 - return $this->mNavigationBar[$class];
 135+ return $this->mNavigationBar;
158136 }
159137
160138 function formatRow( $row ) {
@@ -432,32 +410,10 @@
433411 return in_array( $field, $sortableFields );
434412 }
435413
436 - function getNavigationBar( $class = 'wl-navbar-any' ) {
437 - if ( !isset( $this->mNavigationBar[$class] ) ) {
438 - global $wgLang;
439 -
440 - $nicenumber = $wgLang->formatNum( $this->mLimit );
441 - $linkTexts = array(
442 - 'prev' => wfMsgHtml( 'wikilog-pager-prev' ),
443 - 'next' => wfMsgHtml( 'wikilog-pager-next' ),
444 - 'first' => wfMsgHtml( 'wikilog-pager-first' ),
445 - 'last' => wfMsgHtml( 'wikilog-pager-last' )
446 - );
447 - $pagingLinks = $this->getPagingLinks( $linkTexts );
448 - $limitLinks = $this->getLimitLinks();
449 -
450 - $limits = $wgLang->pipeList( $limitLinks );
451 - $classes = implode( ' ', array( 'wl-navbar', $class ) );
452 -
453 - $this->mNavigationBar[$class] = wfMsgExt( 'wikilog-navigation-bar',
454 - array( 'parsemag' ),
455 - /* $1 */ $pagingLinks['first'],
456 - /* $2 */ $pagingLinks['prev'],
457 - /* $3 */ $pagingLinks['next'],
458 - /* $4 */ $pagingLinks['last'],
459 - /* $5 */ $limits,
460 - /* $6 */ $classes
461 - );
 414+ function getNavigationBar() {
 415+ if ( !isset( $this->mNavigationBar ) ) {
 416+ $navbar = new WikilogNavbar( $this, 'pages' );
 417+ $this->mNavigationBar = $navbar->getNavigationBar( $this->mLimit );
462418 }
463419 return $this->mNavigationBar[$class];
464420 }
Index: trunk/extensions/Wikilog/WikilogDefaultSettings.php
@@ -84,12 +84,6 @@
8585 */
8686 $wgWikilogExtSummaries = false;
8787
88 -/**
89 - * Navigation bars to show in listing pages.
90 - */
91 -$wgWikilogNavTop = false;
92 -$wgWikilogNavBottom = true;
93 -
9488 /* *** Editing *** */
9589
9690 /**
Index: trunk/extensions/Wikilog/Wikilog.i18n.php
@@ -183,11 +183,6 @@
184184 'wikilog-summary' => '', # Special page summary
185185 'wikilog-backlink' => '← $1',
186186 'wikilog-brackets' => '[$1]',
187 - 'wikilog-navigation-bar' => '<div class="$6 visualClear">
188 -<div style="float:left">$1 • $2</div>
189 -<div style="float:right">$3 • $4</div>
190 -&nbsp;
191 -</div>',
192187 );
193188
194189 /** Message documentation (Message documentation)

Follow-up revisions

RevisionCommit summaryAuthorDate
r62500Follow-up r62493 for translatewikiraymond07:31, 15 February 2010

Status & tagging log