Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | |
50 | 50 | $method = $wgRequest->getVal( 'method' ); |
51 | 51 | // Handle form sumissions |
52 | | - if ( $this->editable && $wgRequest->wasPosted() ) { |
| 52 | + if ( $this->editable && $wgRequest->wasPosted() ) { |
53 | 53 | |
54 | 54 | // Check authentication token |
55 | 55 | if ( $wgUser->matchEditToken( $wgRequest->getVal( 'authtoken' ) ) ) { |
— | — | @@ -411,12 +411,7 @@ |
412 | 412 | // If there are campaigns to show... |
413 | 413 | if ( $dbr->numRows( $res ) >= 1 ) { |
414 | 414 | if ( $this->editable ) { |
415 | | - $htmlOut .= Xml::openElement( 'form', |
416 | | - array( |
417 | | - 'method' => 'post', |
418 | | - 'action' => $this->getTitle()->getFullUrl() |
419 | | - ) |
420 | | - ); |
| 415 | + $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
421 | 416 | } |
422 | 417 | $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-manage' ) ); |
423 | 418 | |
— | — | @@ -549,12 +544,7 @@ |
550 | 545 | $htmlOut .= Xml::openElement( 'fieldset', array( 'class' => 'prefsection' ) ); |
551 | 546 | |
552 | 547 | // Form for adding a campaign |
553 | | - $htmlOut .= Xml::openElement( 'form', |
554 | | - array( |
555 | | - 'method' => 'post', |
556 | | - 'action' => $this->getTitle()->getLocalUrl() |
557 | | - ) |
558 | | - ); |
| 548 | + $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
559 | 549 | $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-add-notice' ) ); |
560 | 550 | $htmlOut .= Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ); |
561 | 551 | $htmlOut .= Xml::hidden( 'method', 'addNotice' ); |
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -155,12 +155,7 @@ |
156 | 156 | $htmlOut .= Xml::element( 'p', null, wfMsg( 'centralnotice-no-templates' ) ); |
157 | 157 | } else { |
158 | 158 | if ( $this->editable ) { |
159 | | - $htmlOut .= Xml::openElement( 'form', |
160 | | - array( |
161 | | - 'method' => 'post', |
162 | | - 'action' => '' |
163 | | - ) |
164 | | - ); |
| 159 | + $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
165 | 160 | } |
166 | 161 | $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-manage-templates' ) ); |
167 | 162 | |
— | — | @@ -562,19 +557,12 @@ |
563 | 558 | private function removeTemplate ( $name ) { |
564 | 559 | global $wgOut; |
565 | 560 | |
566 | | - // FIXME: weak comparison |
567 | | - if ( $name == '' ) { |
568 | | - // FIXME: message not defined? |
569 | | - $wgOut->addWikiMsg( 'centralnotice-template-doesnt-exist' ); |
570 | | - return; |
571 | | - } |
572 | | - |
573 | 561 | $id = $this->getTemplateId( $name ); |
574 | 562 | $dbr = wfGetDB( DB_SLAVE ); |
575 | 563 | $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ ); |
576 | 564 | |
577 | 565 | if ( $dbr->numRows( $res ) > 0 ) { |
578 | | - $wgOut->addWikiMsg( 'centralnotice-template-still-bound' ); |
| 566 | + $wgOut->addHTML( Xml::element( 'div', array( 'class' => 'cn-error' ), wfMsg( 'centralnotice-template-still-bound' ) ) ); |
579 | 567 | return; |
580 | 568 | } else { |
581 | 569 | $dbw = wfGetDB( DB_MASTER ); |