Index: trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php |
— | — | @@ -730,7 +730,7 @@ |
731 | 731 | $article->doEdit( $translation, '', EDIT_FORCE_BOT ); |
732 | 732 | } |
733 | 733 | |
734 | | - private function getTemplateId ( $templateName ) { |
| 734 | + private static function getTemplateId ( $templateName ) { |
735 | 735 | $dbr = wfGetDB( DB_SLAVE ); |
736 | 736 | $res = $dbr->select( 'cn_templates', 'tmp_id', |
737 | 737 | array( 'tmp_name' => $templateName ), |
— | — | @@ -756,7 +756,7 @@ |
757 | 757 | } |
758 | 758 | |
759 | 759 | private function removeTemplate ( $name ) { |
760 | | - $id = $this->getTemplateId( $name ); |
| 760 | + $id = SpecialNoticeTemplate::getTemplateId( $name ); |
761 | 761 | $dbr = wfGetDB( DB_SLAVE ); |
762 | 762 | $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ ); |
763 | 763 | |
— | — | @@ -764,6 +764,9 @@ |
765 | 765 | $this->showError( 'centralnotice-template-still-bound' ); |
766 | 766 | return; |
767 | 767 | } else { |
| 768 | + // Log the removal of the banner |
| 769 | + $this->logBannerChange( 'removed', $id ); |
| 770 | + |
768 | 771 | $dbw = wfGetDB( DB_MASTER ); |
769 | 772 | $dbw->begin(); |
770 | 773 | $dbw->delete( 'cn_templates', |
Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
— | — | @@ -52,10 +52,10 @@ |
53 | 53 | // TODO: interface for switching between log types. |
54 | 54 | $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-switcher' ) ); |
55 | 55 | |
56 | | - $htmlOut .= Xml::radio( 'log_type', 'campaign', true ); |
| 56 | + $htmlOut .= Xml::radio( 'log_type', 'campaign', ( $this->logType == 'campaignsettings' ? true : false ) ); |
57 | 57 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-campaign-settings' ), 'campaign' ); |
58 | 58 | |
59 | | - $htmlOut .= Xml::radio( 'log_type', 'banner', false ); |
| 59 | + $htmlOut .= Xml::radio( 'log_type', 'banner', ( $this->logType == 'bannersettings' ? true : false ) ); |
60 | 60 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-settings' ), 'banner' ); |
61 | 61 | |
62 | 62 | $htmlOut .= Xml::closeElement( 'div' ); |
Index: trunk/extensions/CentralNotice/centralnotice.css |
— | — | @@ -72,6 +72,9 @@ |
73 | 73 | #preferences .cn-log-label { |
74 | 74 | font-weight: bold; |
75 | 75 | } |
| 76 | +#preferences #cn-log-switcher label { |
| 77 | + margin-right: 1em; |
| 78 | +} |
76 | 79 | |
77 | 80 | /* Vector-specific definitions */ |
78 | 81 | body.skin-vector #preferences fieldset.prefsection { |