Index: trunk/extensions/Wikilog/SpecialWikilog.php |
— | — | @@ -129,7 +129,6 @@ |
130 | 130 | */ |
131 | 131 | public function webOutput( FormOptions $opts ) { |
132 | 132 | global $wgRequest, $wgOut, $wgMimeType, $wgTitle, $wgParser; |
133 | | - global $wgWikilogNavTop, $wgWikilogNavBottom; |
134 | 133 | |
135 | 134 | # Set page title, html title, nofollow, noindex, etc... |
136 | 135 | $this->setHeaders(); |
— | — | @@ -179,10 +178,7 @@ |
180 | 179 | $body .= $pager->getBody(); |
181 | 180 | |
182 | 181 | # 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(); |
187 | 183 | } |
188 | 184 | |
189 | 185 | # Output. |
Index: trunk/extensions/Wikilog/WikilogMainPage.php |
— | — | @@ -60,7 +60,6 @@ |
61 | 61 | */ |
62 | 62 | public function view() { |
63 | 63 | global $wgRequest, $wgOut, $wgMimeType; |
64 | | - global $wgWikilogNavTop, $wgWikilogNavBottom; |
65 | 64 | |
66 | 65 | $query = new WikilogItemQuery( $this->mTitle ); |
67 | 66 | $query->setPubStatus( $wgRequest->getVal( 'show' ) ); |
— | — | @@ -98,8 +97,7 @@ |
99 | 98 | |
100 | 99 | # Display list of wikilog posts. |
101 | 100 | $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(); |
104 | 102 | $wgOut->addHTML( Xml::openElement( 'div', array( 'class' => 'wl-wrapper' ) ) ); |
105 | 103 | $wgOut->addHTML( $body ); |
106 | 104 | $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
Index: trunk/extensions/Wikilog/WikilogPager.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | interface WikilogPager |
36 | 36 | { |
37 | 37 | function including( $x = null ); |
38 | | - function getNavigationBar( $class = 'wl-navbar-any' ); |
| 38 | + function getNavigationBar(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
— | — | @@ -126,34 +126,12 @@ |
127 | 127 | return '<div class="wl-empty">' . wfMsgExt( 'wikilog-pager-empty', array( 'parsemag' ) ) . "</div>"; |
128 | 128 | } |
129 | 129 | |
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 ); |
156 | 134 | } |
157 | | - return $this->mNavigationBar[$class]; |
| 135 | + return $this->mNavigationBar; |
158 | 136 | } |
159 | 137 | |
160 | 138 | function formatRow( $row ) { |
— | — | @@ -432,32 +410,10 @@ |
433 | 411 | return in_array( $field, $sortableFields ); |
434 | 412 | } |
435 | 413 | |
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 ); |
462 | 418 | } |
463 | 419 | return $this->mNavigationBar[$class]; |
464 | 420 | } |
Index: trunk/extensions/Wikilog/WikilogDefaultSettings.php |
— | — | @@ -84,12 +84,6 @@ |
85 | 85 | */ |
86 | 86 | $wgWikilogExtSummaries = false; |
87 | 87 | |
88 | | -/** |
89 | | - * Navigation bars to show in listing pages. |
90 | | - */ |
91 | | -$wgWikilogNavTop = false; |
92 | | -$wgWikilogNavBottom = true; |
93 | | - |
94 | 88 | /* *** Editing *** */ |
95 | 89 | |
96 | 90 | /** |
Index: trunk/extensions/Wikilog/Wikilog.i18n.php |
— | — | @@ -183,11 +183,6 @@ |
184 | 184 | 'wikilog-summary' => '', # Special page summary |
185 | 185 | 'wikilog-backlink' => '← $1', |
186 | 186 | '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 | | - |
191 | | -</div>', |
192 | 187 | ); |
193 | 188 | |
194 | 189 | /** Message documentation (Message documentation) |