r92827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92826‎ | r92827 | r92828 >
Date:23:35, 21 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
log removing of banners, select correct radio button on load, formatting tweak
Modified paths:
  • /trunk/extensions/CentralNotice/centralnotice.css (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php
@@ -730,7 +730,7 @@
731731 $article->doEdit( $translation, '', EDIT_FORCE_BOT );
732732 }
733733
734 - private function getTemplateId ( $templateName ) {
 734+ private static function getTemplateId ( $templateName ) {
735735 $dbr = wfGetDB( DB_SLAVE );
736736 $res = $dbr->select( 'cn_templates', 'tmp_id',
737737 array( 'tmp_name' => $templateName ),
@@ -756,7 +756,7 @@
757757 }
758758
759759 private function removeTemplate ( $name ) {
760 - $id = $this->getTemplateId( $name );
 760+ $id = SpecialNoticeTemplate::getTemplateId( $name );
761761 $dbr = wfGetDB( DB_SLAVE );
762762 $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ );
763763
@@ -764,6 +764,9 @@
765765 $this->showError( 'centralnotice-template-still-bound' );
766766 return;
767767 } else {
 768+ // Log the removal of the banner
 769+ $this->logBannerChange( 'removed', $id );
 770+
768771 $dbw = wfGetDB( DB_MASTER );
769772 $dbw->begin();
770773 $dbw->delete( 'cn_templates',
Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
@@ -52,10 +52,10 @@
5353 // TODO: interface for switching between log types.
5454 $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-switcher' ) );
5555
56 - $htmlOut .= Xml::radio( 'log_type', 'campaign', true );
 56+ $htmlOut .= Xml::radio( 'log_type', 'campaign', ( $this->logType == 'campaignsettings' ? true : false ) );
5757 $htmlOut .= Xml::label( wfMsg( 'centralnotice-campaign-settings' ), 'campaign' );
5858
59 - $htmlOut .= Xml::radio( 'log_type', 'banner', false );
 59+ $htmlOut .= Xml::radio( 'log_type', 'banner', ( $this->logType == 'bannersettings' ? true : false ) );
6060 $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-settings' ), 'banner' );
6161
6262 $htmlOut .= Xml::closeElement( 'div' );
Index: trunk/extensions/CentralNotice/centralnotice.css
@@ -72,6 +72,9 @@
7373 #preferences .cn-log-label {
7474 font-weight: bold;
7575 }
 76+#preferences #cn-log-switcher label {
 77+ margin-right: 1em;
 78+}
7679
7780 /* Vector-specific definitions */
7881 body.skin-vector #preferences fieldset.prefsection {

Follow-up revisions

RevisionCommit summaryAuthorDate
r95708MFT r92827 - r95707 for payflowpro i18n changesawjrichards22:02, 29 August 2011

Status & tagging log