r83830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83829‎ | r83830 | r83831 >
Date:16:09, 13 March 2011
Author:ialex
Status:deferred
Tags:
Comment:
* Use Skin::getTitle() instead of $wgTitle
* Changed hook to SkinTemplateNavigation::SpecialPage instead of SkinTemplateNavigation so that it works correctly
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/Storyboard.php
@@ -70,7 +70,7 @@
7171 // as they should, since they are only getting called for content pages. There is no
7272 // good reason why they are not called on special pages, sho this should be changed in core.
7373 $wgHooks['SkinTemplateTabs'][] = 'efStoryboardAddStoryEditAction';
74 -$wgHooks['SkinTemplateNavigation'][] = 'efStoryboardAddStoryEditActionVector';
 74+$wgHooks['SkinTemplateNavigation::SpecialPage'][] = 'efStoryboardAddStoryEditActionVector';
7575
7676
7777 /**
@@ -125,15 +125,16 @@
126126 }
127127
128128 function efStoryboardAddStoryEditAction( &$sktemplate, &$content_actions ) {
129 - global $wgRequest, $wgRequest, $wgTitle;
 129+ global $wgRequest;
130130
131131 $action = $wgRequest->getText( 'action' );
 132+ $title = $sktemplate->getTitle();
132133
133 - if ( $wgTitle->equals( SpecialPage::getTitleFor( 'story' ) ) ) {
 134+ if ( $title->isSpecial( 'Story' ) ) {
134135 $content_actions['edit'] = array(
135136 'class' => $action == 'edit' ? 'selected' : false,
136137 'text' => wfMsg( 'edit' ),
137 - 'href' => $wgTitle->getLocalUrl( 'action=edit' )
 138+ 'href' => $title->getLocalUrl( 'action=edit' )
138139 );
139140 }
140141
@@ -181,4 +182,4 @@
182183 global $wgOut;
183184 $wgOut->addInlineScript( $js );
184185 }
185 -}
\ No newline at end of file
 186+}

Status & tagging log