| Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php |
| — | — | @@ -219,6 +219,23 @@ |
| 220 | 220 | $this->doInlineEditForm(); |
| 221 | 221 | return false; |
| 222 | 222 | } |
| | 223 | + |
| | 224 | + // Search! |
| | 225 | + if ( $this->request->getCheck( 'lqt_search' ) ) { |
| | 226 | + $q = $this->request->getText( 'lqt_search' ); |
| | 227 | + $q .= ' ondiscussionpage:'.$article->getID(); |
| | 228 | + |
| | 229 | + $params = array( 'search' => $q, |
| | 230 | + 'fulltext' => 1, |
| | 231 | + 'ns'.NS_LQT_THREAD => 1, |
| | 232 | + ); |
| | 233 | + |
| | 234 | + $t = SpecialPage::getTitleFor( 'Search' ); |
| | 235 | + $url = $t->getLocalURL( wfArrayToCGI( $params ) ); |
| | 236 | + |
| | 237 | + $this->output->redirect( $url ); |
| | 238 | + |
| | 239 | + } |
| 223 | 240 | |
| 224 | 241 | $this->showHeader(); |
| 225 | 242 | |
| — | — | @@ -238,6 +255,8 @@ |
| 239 | 256 | $this->output->addHTML( Xml::tags( 'strong', null, $newThreadLink ) ); |
| 240 | 257 | } |
| 241 | 258 | |
| | 259 | + $this->showSearchBox(); |
| | 260 | + |
| 242 | 261 | $pager = $this->getPager(); |
| 243 | 262 | |
| 244 | 263 | $threads = $this->getPageThreads( $pager ); |
| — | — | @@ -262,6 +281,24 @@ |
| 263 | 282 | return false; |
| 264 | 283 | } |
| 265 | 284 | |
| | 285 | + function showSearchBox() { |
| | 286 | + $html = ''; |
| | 287 | + $html .= Xml::inputLabel( wfMsg('lqt-search-label'), 'lqt_search', 'lqt-search-box', |
| | 288 | + 60 ); |
| | 289 | + |
| | 290 | + $html .= ' ' . Xml::submitButton( wfMsg( 'lqt-search-button' ) ); |
| | 291 | + $html .= Xml::hidden( 'title', $this->title->getPrefixedText() ); |
| | 292 | + $html = Xml::tags( 'form', |
| | 293 | + array( 'action' => $this->title->getLocalURL(), |
| | 294 | + 'method' => 'get' ), |
| | 295 | + $html ); |
| | 296 | + |
| | 297 | + $html = Xml::fieldset( wfMsg('lqt-search-legend' ), $html, |
| | 298 | + array( 'class' => 'lqt-talkpage-search' ) ); |
| | 299 | + |
| | 300 | + $this->output->addHTML( $html ); |
| | 301 | + } |
| | 302 | + |
| 266 | 303 | function getPager() { |
| 267 | 304 | $showDeleted = $this->request->getBool( 'lqt_show_deleted_threads' ); |
| 268 | 305 | $showDeleted = $showDeleted && $this->user->isAllowed( 'deletedhistory' ); |
| Index: trunk/extensions/LiquidThreads/lqt.css |
| — | — | @@ -578,3 +578,14 @@ |
| 579 | 579 | margin: 0; |
| 580 | 580 | display: inline-block; |
| 581 | 581 | } |
| | 582 | + |
| | 583 | +fieldset.lqt-talkpage-search { |
| | 584 | + width: auto; |
| | 585 | + text-align: center; |
| | 586 | + margin: 0.5em 15%; |
| | 587 | + padding: 1em; |
| | 588 | +} |
| | 589 | + |
| | 590 | +fieldset.lqt-talkpage-search legend { |
| | 591 | + text-align: center; |
| | 592 | +} |