Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -280,7 +280,17 @@ |
281 | 281 | } |
282 | 282 | |
283 | 283 | class TalkpageView extends LqtView { |
| 284 | + /* Added to SkinTemplateTabs hook in TalkpageView::show(). */ |
| 285 | + function customizeTabs( $skintemplate, $content_actions ) { |
| 286 | + // The arguments are passed in by reference. |
| 287 | + unset($content_actions['edit']); |
| 288 | + unset($content_actions['addsection']); |
| 289 | + unset($content_actions['history']); |
| 290 | + } |
284 | 291 | function show() { |
| 292 | + global $wgHooks; |
| 293 | + $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
| 294 | + |
285 | 295 | $this->output->setPageTitle( "Talk:" . $this->title->getText() ); |
286 | 296 | |
287 | 297 | if( $this->request->getBool('lqt_new_thread_form') ) { |
Index: branches/liquidthreads/includes/SkinTemplate.php |
— | — | @@ -668,7 +668,7 @@ |
669 | 669 | true); |
670 | 670 | |
671 | 671 | wfProfileIn( "$fname-edit" ); |
672 | | - if ( !$this->mTitle->isTalkPage() /*LQT HACK*/ && $this->mTitle->quickUserCan( 'edit' ) && ( $this->mTitle->exists() || $this->mTitle->quickUserCan( 'create' ) ) ) { |
| 672 | + if ( $this->mTitle->quickUserCan( 'edit' ) && ( $this->mTitle->exists() || $this->mTitle->quickUserCan( 'create' ) ) ) { |
673 | 673 | $istalk = $this->mTitle->isTalkPage(); |
674 | 674 | $istalkclass = $istalk?' istalk':''; |
675 | 675 | $content_actions['edit'] = array( |
— | — | @@ -684,7 +684,7 @@ |
685 | 685 | 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) |
686 | 686 | ); |
687 | 687 | } |
688 | | - } else if ( !$this->mTitle->isTalkPage() /*LQT HACK*/ ) { |
| 688 | + } else { |
689 | 689 | $content_actions['viewsource'] = array( |
690 | 690 | 'class' => ($action == 'edit') ? 'selected' : false, |
691 | 691 | 'text' => wfMsg('viewsource'), |
— | — | @@ -765,7 +765,6 @@ |
766 | 766 | } |
767 | 767 | } |
768 | 768 | |
769 | | - |
770 | 769 | wfRunHooks( 'SkinTemplateTabs', array( &$this , &$content_actions ) ) ; |
771 | 770 | } else { |
772 | 771 | /* show special page tab */ |