r98905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98904‎ | r98905 | r98906 >
Date:20:43, 4 October 2011
Author:awjrichards
Status:ok
Tags:
Comment:
MFT r95822
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
@@ -55,22 +55,16 @@
5656 $title = SpecialPage::getTitleFor( 'CentralNoticeLogs' );
5757 $fullUrl = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT );
5858
59 - $htmlOut .= Xml::radio(
60 - 'log_type',
61 - 'campaign',
62 - ( $this->logType == 'campaignsettings' ? true : false ),
63 - array( 'onclick' => "switchLogs( '".$fullUrl."', 'campaignsettings' )" )
64 - );
65 - $htmlOut .= Xml::label( wfMsg( 'centralnotice-campaign-settings' ), 'campaign' );
 59+ // Build the radio buttons for switching the log type
 60+ $htmlOut .= $this->getLogSwitcher( 'campaignsettings', 'campaignSettings',
 61+ 'centralnotice-campaign-settings', $fullUrl );
 62+ $htmlOut .= $this->getLogSwitcher( 'bannersettings', 'bannerSettings',
 63+ 'centralnotice-banner-settings', $fullUrl );
 64+ $htmlOut .= $this->getLogSwitcher( 'bannercontent', 'bannerContent',
 65+ 'centralnotice-banner-content', $fullUrl );
 66+ $htmlOut .= $this->getLogSwitcher( 'bannermessages', 'bannerMessages',
 67+ 'centralnotice-banner-messages', $fullUrl );
6668
67 - $htmlOut .= Xml::radio(
68 - 'log_type',
69 - 'banner',
70 - ( $this->logType == 'bannersettings' ? true : false ),
71 - array( 'onclick' => "switchLogs( '".$fullUrl."', 'bannersettings' )" )
72 - );
73 - $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-settings' ), 'banner' );
74 -
7569 $htmlOut .= Xml::closeElement( 'div' );
7670
7771 if ( $this->logType == 'campaignsettings' ) {
@@ -221,10 +215,16 @@
222216 function showLog( $logType ) {
223217 global $wgOut;
224218
225 - if ( $logType == 'bannersettings' ) {
226 - $pager = new CentralNoticeBannerLogPager( $this );
227 - } else {
228 - $pager = new CentralNoticeLogPager( $this );
 219+ switch ( $logType ) {
 220+ case 'bannersettings':
 221+ $pager = new CentralNoticeBannerLogPager( $this );
 222+ break;
 223+ case 'bannercontent':
 224+ case 'bannermessages':
 225+ $pager = new CentralNoticePageLogPager( $this, $logType );
 226+ break;
 227+ default:
 228+ $pager = new CentralNoticeCampaignLogPager( $this );
229229 }
230230
231231 $htmlOut = '';
@@ -247,11 +247,26 @@
248248 $wgOut->addHTML( $htmlOut );
249249 }
250250
251 - private function getDateValue( $type ) {
 251+ static function getDateValue( $type ) {
252252 global $wgRequest;
253253 $value = $wgRequest->getVal( $type );
254254 if ( $value === 'other' ) $value = null;
255255 return $value;
256256 }
 257+
 258+ /**
 259+ * Build a radio button that switches the log type when you click it
 260+ */
 261+ private function getLogSwitcher( $type, $id, $message, $fullUrl ) {
 262+ $htmlOut = '';
 263+ $htmlOut .= Xml::radio(
 264+ 'log_type',
 265+ $id,
 266+ ( $this->logType == $type ? true : false ),
 267+ array( 'onclick' => "switchLogs( '".$fullUrl."', '".$type."' )" )
 268+ );
 269+ $htmlOut .= Xml::label( wfMsg( $message ), $id );
 270+ return $htmlOut;
 271+ }
257272
258273 }
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
___________________________________________________________________
Modified: svn:mergeinfo
259274 Merged /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php:r95822

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95822adding banner content and banner message logging to CentralNoticekaldari00:06, 31 August 2011

Status & tagging log