r70446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70445‎ | r70446 | r70447 >
Date:01:25, 4 August 2010
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
Fixing getTitle calls per comment in r70440
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -419,7 +419,7 @@
420420 $htmlOut .= Xml::openElement( 'form',
421421 array(
422422 'method' => 'post',
423 - 'action' => SpecialPage::getTitleFor( 'CentralNotice' )->getFullUrl()
 423+ 'action' => $this->getTitle()->getFullUrl()
424424 )
425425 );
426426 }
@@ -548,7 +548,7 @@
549549 $htmlOut .= Xml::openElement( 'form',
550550 array(
551551 'method' => 'post',
552 - 'action' => SpecialPage::getTitleFor( 'CentralNotice' )->getLocalUrl()
 552+ 'action' => $this->getTitle()->getLocalUrl()
553553 )
554554 );
555555 $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-add-notice' ) );
@@ -634,7 +634,7 @@
635635 $this->addTemplateTo( $notice, $template, $weight[$template] );
636636 }
637637 }
638 - $wgOut->redirect( SpecialPage::getTitleFor( 'CentralNotice' )->getLocalUrl( "method=listNoticeDetail&notice=$notice" ) );
 638+ $wgOut->redirect( $this->getTitle()->getLocalUrl( "method=listNoticeDetail&notice=$notice" ) );
639639 return;
640640 }
641641
@@ -647,7 +647,7 @@
648648 $htmlOut .= Xml::openElement( 'form',
649649 array(
650650 'method' => 'post',
651 - 'action' => SpecialPage::getTitleFor( 'CentralNotice' )->getLocalUrl( "method=listNoticeDetail&notice=$notice" )
 651+ 'action' => $this->getTitle()->getLocalUrl( "method=listNoticeDetail&notice=$notice" )
652652 )
653653 );
654654 }
@@ -671,7 +671,7 @@
672672 if ( $output_assigned == '' && $output_templates == '' ) {
673673 $htmlOut .= wfMsg( 'centralnotice-no-templates' );
674674 $htmlOut .= Xml::element( 'p' );
675 - $newPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'add' );
 675+ $newPage = $this->getTitleFor( 'NoticeTemplate', 'add' );
676676 $sk = $wgUser->getSkin();
677677 $htmlOut .= $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-add-template' ) );
678678 $htmlOut .= Xml::element( 'p' );
@@ -863,7 +863,7 @@
864864 $this->weightDropDown( "weight[$row->tmp_name]", $row->tmp_weight )
865865 );
866866
867 - $viewPage = SpecialPage::getTitleFor( 'NoticeTemplate/view' );
 867+ $viewPage = $this->getTitleFor( 'NoticeTemplate', 'view' );
868868 $render = new SpecialNoticeText();
869869 $render->project = 'wikipedia';
870870 global $wgRequest;
@@ -961,7 +961,7 @@
962962 );
963963
964964 // Render preview
965 - $viewPage = SpecialPage::getTitleFor( 'NoticeTemplate/view' );
 965+ $viewPage = $this->getTitleFor( 'NoticeTemplate', 'view' );
966966 $render = new SpecialNoticeText();
967967 $render->project = 'wikipedia';
968968 global $wgRequest;
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -113,7 +113,7 @@
114114 $newTemplate = $wgRequest->getVal( 'newTemplate' );
115115 // We use the returned name in case any special characters had to be removed
116116 $template = $this->cloneTemplate( $oldTemplate, $newTemplate );
117 - $wgOut->redirect( SpecialPage::getTitleFor( 'NoticeTemplate', 'view' )->getLocalUrl( "template=$template" ) );
 117+ $wgOut->redirect( $this->getTitle( 'view' )->getLocalUrl( "template=$template" ) );
118118 return;
119119 }
120120 }
@@ -163,7 +163,7 @@
164164
165165 if ( $this->editable ) {
166166 $htmlOut .= Xml::element( 'p' );
167 - $newPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'add' );
 167+ $newPage = $this->getTitle( 'add' );
168168 $htmlOut .= $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-add-template' ) );
169169 }
170170
@@ -358,7 +358,7 @@
359359 $htmlOut .= Xml::openElement( 'table', array ( 'cellpadding' => 9 ) );
360360 list( $lsLabel, $lsSelect ) = Xml::languageSelector( $wpUserLang );
361361
362 - $newPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' );
 362+ $newPage = $this->getTitle( 'view' );
363363
364364 $htmlOut .= Xml::tags( 'tr', null,
365365 Xml::tags( 'td', null, $lsLabel ) .
@@ -414,7 +414,7 @@
415415 $htmlOut .= Xml::openElement ( 'form',
416416 array(
417417 'method' => 'post',
418 - 'action' => SpecialPage::getTitleFor( 'NoticeTemplate', 'clone' )->getLocalUrl()
 418+ 'action' => $this->getTitle( 'clone' )->getLocalUrl()
419419 )
420420 );
421421
@@ -458,7 +458,7 @@
459459
460460 foreach ( $langs as $lang ) {
461461 // Link and Preview all available translations
462 - $viewPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' );
 462+ $viewPage = $this->getTitle( 'view' );
463463 $render = new SpecialNoticeText();
464464 $render->project = 'wikipedia';
465465 $render->language = $lang;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70440Fix for form issueskaldari00:05, 4 August 2010

Comments

#Comment by Nikerabbit (talk | contribs)   01:53, 4 August 2010

Nice.

Status & tagging log