r22491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22490‎ | r22491 | r22492 >
Date:00:15, 28 May 2007
Author:david
Status:old
Tags:
Comment:
Remove unwanted tabs in a cleaner way than before.
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/includes/SkinTemplate.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -280,7 +280,17 @@
281281 }
282282
283283 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+ }
284291 function show() {
 292+ global $wgHooks;
 293+ $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs');
 294+
285295 $this->output->setPageTitle( "Talk:" . $this->title->getText() );
286296
287297 if( $this->request->getBool('lqt_new_thread_form') ) {
Index: branches/liquidthreads/includes/SkinTemplate.php
@@ -668,7 +668,7 @@
669669 true);
670670
671671 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' ) ) ) {
673673 $istalk = $this->mTitle->isTalkPage();
674674 $istalkclass = $istalk?' istalk':'';
675675 $content_actions['edit'] = array(
@@ -684,7 +684,7 @@
685685 'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
686686 );
687687 }
688 - } else if ( !$this->mTitle->isTalkPage() /*LQT HACK*/ ) {
 688+ } else {
689689 $content_actions['viewsource'] = array(
690690 'class' => ($action == 'edit') ? 'selected' : false,
691691 'text' => wfMsg('viewsource'),
@@ -765,7 +765,6 @@
766766 }
767767 }
768768
769 -
770769 wfRunHooks( 'SkinTemplateTabs', array( &$this , &$content_actions ) ) ;
771770 } else {
772771 /* show special page tab */