r71645 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71644‎ | r71645 | r71646 >
Date:18:57, 25 August 2010
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
correct display of banners for non-logged-in users, removing unused var
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)
  • /trunk/extensions/CentralNotice/TemplatePager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/TemplatePager.php
@@ -2,7 +2,6 @@
33
44 class TemplatePager extends ReverseChronologicalPager {
55 var $onRemoveChange, $viewPage, $special;
6 - var $editable;
76
87 function __construct( $special ) {
98 $this->special = $special;
@@ -41,15 +40,17 @@
4241 // Begin banner row
4342 $htmlOut = Xml::openElement( 'tr' );
4443
45 - // Remove box
46 - $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
47 - Xml::check( 'removeTemplates[]', false,
48 - array(
49 - 'value' => $row->tmp_name,
50 - 'onchange' => $this->onRemoveChange
 44+ if ( $this->editable ) {
 45+ // Remove box
 46+ $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
 47+ Xml::check( 'removeTemplates[]', false,
 48+ array(
 49+ 'value' => $row->tmp_name,
 50+ 'onchange' => $this->onRemoveChange
 51+ )
5152 )
52 - )
53 - );
 53+ );
 54+ }
5455
5556 // Link and Preview
5657 $viewPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' );
Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -1329,7 +1329,6 @@
13301330
13311331 class CentralNoticePager extends TemplatePager {
13321332 var $viewPage, $special;
1333 - var $editable;
13341333
13351334 function __construct( $special ) {
13361335 parent::__construct( $special );
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -6,7 +6,6 @@
77 }
88
99 class SpecialNoticeTemplate extends UnlistedSpecialPage {
10 - var $editable;
1110
1211 function __construct() {
1312 parent::__construct( 'NoticeTemplate' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r71676cleaning up form handling so that we can preserve form states, restoring var ...kaldari23:58, 25 August 2010

Comments

#Comment by Catrope (talk | contribs)   21:11, 25 August 2010
-	var $editable;
[...]
+		if ( $this->editable ) {

So how is $editable unused exactly?

#Comment by Kaldari (talk | contribs)   00:19, 26 August 2010

oops, restored in r71676.

Status & tagging log