Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -6,12 +6,11 @@ |
7 | 7 | } |
8 | 8 | |
9 | 9 | class CentralNotice extends SpecialPage { |
10 | | - var $centralNoticeDB; |
11 | | - /* Functions */ |
12 | | - |
13 | | - function CentralNotice() { |
| 10 | + var $centralNoticeDB, $editable, $centralNoticeError; |
| 11 | + |
| 12 | + function __construct() { |
14 | 13 | // Register special page |
15 | | - parent::SpecialPage( 'CentralNotice' ); |
| 14 | + parent::__construct( 'CentralNotice' ); |
16 | 15 | |
17 | 16 | // Internationalization |
18 | 17 | wfLoadExtensionMessages( 'CentralNotice' ); |
— | — | @@ -36,6 +35,9 @@ |
37 | 36 | |
38 | 37 | // Check permissions |
39 | 38 | $this->editable = $wgUser->isAllowed( 'centralnotice-admin' ); |
| 39 | + |
| 40 | + // Initialize error variable |
| 41 | + $this->centralNoticeError = false; |
40 | 42 | |
41 | 43 | // Show summary |
42 | 44 | $wgOut->addWikiText( wfMsg( 'centralnotice-summary' ) ); |
— | — | @@ -48,7 +50,15 @@ |
49 | 51 | |
50 | 52 | $method = $wgRequest->getVal( 'method' ); |
51 | 53 | |
52 | | - // Handle form submissions |
| 54 | + // Switch to campaign detail interface if requested |
| 55 | + if ( $method == 'listNoticeDetail' ) { |
| 56 | + $notice = $wgRequest->getVal ( 'notice' ); |
| 57 | + $this->listNoticeDetail( $notice ); |
| 58 | + $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
| 59 | + return; |
| 60 | + } |
| 61 | + |
| 62 | + // Handle form submissions from "Manage campaigns" or "Add a campaign" interface |
53 | 63 | if ( $this->editable && $wgRequest->wasPosted() ) { |
54 | 64 | |
55 | 65 | // Check authentication token |
— | — | @@ -56,13 +66,13 @@ |
57 | 67 | |
58 | 68 | // Handle removing campaigns |
59 | 69 | $toRemove = $wgRequest->getArray( 'removeNotices' ); |
60 | | - if ( isset( $toRemove ) ) { |
| 70 | + if ( $toRemove ) { |
61 | 71 | // Remove campaigns in list |
62 | 72 | foreach ( $toRemove as $notice ) { |
63 | 73 | $this->removeNotice( $notice ); |
64 | 74 | } |
65 | 75 | |
66 | | - // Show list of campaigns |
| 76 | + // Skip subsequent form handling and show list of campaigns |
67 | 77 | $this->listNotices(); |
68 | 78 | $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
69 | 79 | return; |
— | — | @@ -70,119 +80,64 @@ |
71 | 81 | |
72 | 82 | // Handle locking/unlocking campaigns |
73 | 83 | $lockedNotices = $wgRequest->getArray( 'locked' ); |
74 | | - if ( isset( $lockedNotices ) ) { |
75 | | - if ( $method == 'listNoticeDetail' ) { |
76 | | - $notice = $wgRequest->getVal ( 'notice' ); |
| 84 | + if ( $lockedNotices ) { |
| 85 | + // Build list of campaigns to lock |
| 86 | + $unlockedNotices = array_diff( $this->getNoticesName(), $lockedNotices ); |
| 87 | + |
| 88 | + // Set locked/unlocked flag accordingly |
| 89 | + foreach ( $lockedNotices as $notice ) { |
77 | 90 | $this->updateLock( $notice, '1' ); |
78 | | - } else { |
79 | | - // Build list of campaigns to lock |
80 | | - $unlockedNotices = array_diff( $this->getNoticesName(), $lockedNotices ); |
81 | | - |
82 | | - // Set locked/unlocked flag accordingly |
83 | | - foreach ( $lockedNotices as $notice ) { |
84 | | - $this->updateLock( $notice, '1' ); |
85 | | - } |
86 | | - foreach ( $unlockedNotices as $notice ) { |
87 | | - $this->updateLock( $notice, '0' ); |
88 | | - } |
89 | 91 | } |
| 92 | + foreach ( $unlockedNotices as $notice ) { |
| 93 | + $this->updateLock( $notice, '0' ); |
| 94 | + } |
| 95 | + // Handle updates if no post content came through (all checkboxes unchecked) |
| 96 | + } elseif ( $method !== 'addNotice' ) { |
| 97 | + $allNotices = $this->getNoticesName(); |
| 98 | + foreach ( $allNotices as $notice ) { |
| 99 | + $this->updateLock( $notice, '0' ); |
| 100 | + } |
90 | 101 | } |
91 | 102 | |
92 | 103 | // Handle enabling/disabling campaigns |
93 | 104 | $enabledNotices = $wgRequest->getArray( 'enabled' ); |
94 | | - if ( isset( $enabledNotices ) ) { |
95 | | - if ( $method == 'listNoticeDetail' ) { |
96 | | - $notice = $wgRequest->getVal ( 'notice' ); |
| 105 | + if ( $enabledNotices ) { |
| 106 | + // Build list of campaigns to disable |
| 107 | + $disabledNotices = array_diff( $this->getNoticesName(), $enabledNotices ); |
| 108 | + |
| 109 | + // Set enabled/disabled flag accordingly |
| 110 | + foreach ( $enabledNotices as $notice ) { |
97 | 111 | $this->updateEnabled( $notice, '1' ); |
98 | | - } else { |
99 | | - // Build list of campaigns to disable |
100 | | - $disabledNotices = array_diff( $this->getNoticesName(), $enabledNotices ); |
101 | | - |
102 | | - // Set enabled/disabled flag accordingly |
103 | | - foreach ( $enabledNotices as $notice ) { |
104 | | - $this->updateEnabled( $notice, '1' ); |
105 | | - } |
106 | | - foreach ( $disabledNotices as $notice ) { |
107 | | - $this->updateEnabled( $notice, '0' ); |
108 | | - } |
109 | 112 | } |
| 113 | + foreach ( $disabledNotices as $notice ) { |
| 114 | + $this->updateEnabled( $notice, '0' ); |
| 115 | + } |
| 116 | + // Handle updates if no post content came through (all checkboxes unchecked) |
| 117 | + } elseif ( $method !== 'addNotice' ) { |
| 118 | + $allNotices = $this->getNoticesName(); |
| 119 | + foreach ( $allNotices as $notice ) { |
| 120 | + $this->updateEnabled( $notice, '0' ); |
| 121 | + } |
110 | 122 | } |
111 | 123 | |
112 | 124 | // Handle setting preferred campaigns |
113 | 125 | $preferredNotices = $wgRequest->getArray( 'preferred' ); |
114 | | - if ( isset( $preferredNotices ) ) { |
115 | | - // Set since this is a single display |
116 | | - if ( $method == 'listNoticeDetail' ) { |
117 | | - $notice = $wgRequest->getVal ( 'notice' ); |
118 | | - $this->centralNoticeDB->updatePreferred( $notice, '1' ); |
119 | | - } |
120 | | - else { |
121 | | - // Build list of campaigns to unset |
122 | | - $unsetNotices = array_diff( $this->getNoticesName(), $preferredNotices ); |
123 | | - |
124 | | - // Set flag accordingly |
125 | | - foreach ( $preferredNotices as $notice ) { |
126 | | - $this->centralNoticeDB->updatePreferred( $notice, '1' ); |
127 | | - } |
128 | | - foreach ( $unsetNotices as $notice ) { |
129 | | - $this->centralNoticeDB->updatePreferred( $notice, '0' ); |
130 | | - } |
131 | | - } |
132 | | - } |
| 126 | + if ( $preferredNotices ) { |
| 127 | + // Build list of campaigns to unset |
| 128 | + $unsetNotices = array_diff( $this->getNoticesName(), $preferredNotices ); |
133 | 129 | |
134 | | - $noticeName = $wgRequest->getVal( 'notice' ); |
135 | | - |
136 | | - // Handle range setting |
137 | | - $start = $wgRequest->getArray( 'start' ); |
138 | | - $end = $wgRequest->getArray( 'end' ); |
139 | | - if ( isset( $start ) && isset( $end ) ) { |
140 | | - $updatedStart = sprintf( "%04d%02d%02d%02d%02d00", |
141 | | - $start['year'], |
142 | | - $start['month'], |
143 | | - $start['day'], |
144 | | - $start['hour'], |
145 | | - $start['min'] ); |
146 | | - $updatedEnd = sprintf( "%04d%02d%02d000000", |
147 | | - $end['year'], |
148 | | - $end['month'], |
149 | | - $end['day'] ); |
150 | | - $this->updateNoticeDate( $noticeName, $updatedStart, $updatedEnd ); |
151 | | - } |
152 | | - |
153 | | - // Handle updates if no post content came through |
154 | | - if ( !isset( $lockedNotices ) && $method !== 'addNotice' ) { |
155 | | - if ( $method == 'listNoticeDetail' ) { |
156 | | - $notice = $wgRequest->getVal ( 'notice' ); |
157 | | - $this->updateLock( $notice, 0 ); |
158 | | - } else { |
159 | | - $allNotices = $this->getNoticesName(); |
160 | | - foreach ( $allNotices as $notice ) { |
161 | | - $this->updateLock( $notice, '0' ); |
162 | | - } |
| 130 | + // Set flag accordingly |
| 131 | + foreach ( $preferredNotices as $notice ) { |
| 132 | + $this->updatePreferred( $notice, '1' ); |
163 | 133 | } |
164 | | - } |
165 | | - |
166 | | - if ( !isset( $enabledNotices ) && $method !== 'addNotice' ) { |
167 | | - if ( $method == 'listNoticeDetail' ) { |
168 | | - $notice = $wgRequest->getVal ( 'notice' ); |
169 | | - $this->updateEnabled( $notice, 0 ); |
170 | | - } else { |
171 | | - $allNotices = $this->getNoticesName(); |
172 | | - foreach ( $allNotices as $notice ) { |
173 | | - $this->updateEnabled( $notice, '0' ); |
174 | | - } |
| 134 | + foreach ( $unsetNotices as $notice ) { |
| 135 | + $this->updatePreferred( $notice, '0' ); |
175 | 136 | } |
176 | | - } |
177 | | - |
178 | | - if ( !isset( $preferredNotices ) && $method !== 'addNotice' ) { |
179 | | - if ( $method == 'listNoticeDetail' ) { |
180 | | - $notice = $wgRequest->getVal ( 'notice' ); |
181 | | - $this->centralNoticeDB->updatePreferred( $notice, 0 ); |
182 | | - } else { |
183 | | - $allNotices = $this->getNoticesName(); |
184 | | - foreach ( $allNotices as $notice ) { |
185 | | - $this->centralNoticeDB->updatePreferred( $notice, '0' ); |
186 | | - } |
| 137 | + // Handle updates if no post content came through (all checkboxes unchecked) |
| 138 | + } elseif ( $method !== 'addNotice' ) { |
| 139 | + $allNotices = $this->getNoticesName(); |
| 140 | + foreach ( $allNotices as $notice ) { |
| 141 | + $this->updatePreferred( $notice, '0' ); |
187 | 142 | } |
188 | 143 | } |
189 | 144 | |
— | — | @@ -193,34 +148,24 @@ |
194 | 149 | $project_name = $wgRequest->getVal( 'project_name' ); |
195 | 150 | $project_languages = $wgRequest->getArray( 'project_languages' ); |
196 | 151 | if ( $noticeName == '' ) { |
197 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-null-string' ); |
| 152 | + $this->showError( 'centralnotice-null-string' ); |
198 | 153 | } else { |
199 | 154 | $this->addNotice( $noticeName, '0', $start, $project_name, $project_languages ); |
200 | 155 | } |
201 | 156 | } |
202 | 157 | |
203 | | - // Handle weight change |
204 | | - $updatedWeights = $wgRequest->getArray( 'weight' ); |
205 | | - if ( isset( $updatedWeights ) ) { |
206 | | - foreach ( $updatedWeights as $templateId => $weight ) { |
207 | | - $this->updateWeight( $noticeName, $templateId, $weight ); |
208 | | - } |
| 158 | + // If there were no errors, reload the page to prevent duplicate form submission |
| 159 | + if ( !$this->centralNoticeError ) { |
| 160 | + $wgOut->redirect( $this->getTitle()->getLocalUrl() ); |
| 161 | + return; |
209 | 162 | } |
210 | | - |
| 163 | + |
211 | 164 | } else { |
212 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'sessionfailure' ); |
| 165 | + $this->showError( 'sessionfailure' ); |
213 | 166 | } |
214 | 167 | |
215 | 168 | } |
216 | 169 | |
217 | | - // Handle showing campaign detail |
218 | | - if ( $method == 'listNoticeDetail' ) { |
219 | | - $notice = $wgRequest->getVal ( 'notice' ); |
220 | | - $this->listNoticeDetail( $notice ); |
221 | | - $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
222 | | - return; |
223 | | - } |
224 | | - |
225 | 170 | // Show list of campaigns |
226 | 171 | $this->listNotices(); |
227 | 172 | |
— | — | @@ -228,19 +173,6 @@ |
229 | 174 | $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
230 | 175 | } |
231 | 176 | |
232 | | - /** |
233 | | - * Update the enabled/disabled state of a campaign |
234 | | - */ |
235 | | - private function updateEnabled( $notice, $state ) { |
236 | | - $dbw = wfGetDB( DB_MASTER ); |
237 | | - $dbw->begin(); |
238 | | - $res = $dbw->update( 'cn_notices', |
239 | | - array( 'not_enabled' => $state ), |
240 | | - array( 'not_name' => $notice ) |
241 | | - ); |
242 | | - $dbw->commit(); |
243 | | - } |
244 | | - |
245 | 177 | public static function printHeader() { |
246 | 178 | global $wgOut, $wgTitle, $wgUser; |
247 | 179 | $sk = $wgUser->getSkin(); |
— | — | @@ -529,11 +461,7 @@ |
530 | 462 | $startArray['min'] . '00' |
531 | 463 | ; |
532 | 464 | $projectSelected = $wgRequest->getVal( 'project_name' ); |
533 | | - if ( $wgRequest->getArray( 'project_languages' ) ) { |
534 | | - $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
535 | | - } else { |
536 | | - $noticeLanguages = array(); |
537 | | - } |
| 465 | + $noticeLanguages = $wgRequest->getArray( 'project_languages', array() ); |
538 | 466 | } else { // Defaults |
539 | 467 | $startTimestamp = null; |
540 | 468 | $projectSelected = ''; |
— | — | @@ -599,56 +527,114 @@ |
600 | 528 | function listNoticeDetail( $notice ) { |
601 | 529 | global $wgOut, $wgRequest, $wgUser; |
602 | 530 | |
603 | | - if ( $wgRequest->wasPosted() ) { |
| 531 | + // Make sure notice exists |
| 532 | + if ( !$this->noticeExists( $notice ) ) { |
| 533 | + $this->showError( 'centralnotice-notice-doesnt-exist' ); |
| 534 | + } else { |
| 535 | + |
| 536 | + // Handle form submissions from campaign detail interface |
| 537 | + if ( $this->editable && $wgRequest->wasPosted() ) { |
| 538 | + |
| 539 | + // Check authentication token |
| 540 | + if ( $wgUser->matchEditToken( $wgRequest->getVal( 'authtoken' ) ) ) { |
| 541 | + |
| 542 | + // Handle removing campaign |
| 543 | + if ( $wgRequest->getVal( 'remove' ) ) { |
| 544 | + $this->removeNotice( $notice ); |
| 545 | + if ( !$this->centralNoticeError ) { |
| 546 | + // Leave campaign detail interface |
| 547 | + $wgOut->redirect( $this->getTitle()->getLocalUrl() ); |
| 548 | + return; |
| 549 | + } |
| 550 | + } |
| 551 | + |
| 552 | + // Handle locking/unlocking campaign |
| 553 | + if ( $wgRequest->getArray( 'locked' ) ) { |
| 554 | + $this->updateLock( $notice, '1' ); |
| 555 | + } else { |
| 556 | + $this->updateLock( $notice, 0 ); |
| 557 | + } |
| 558 | + |
| 559 | + // Handle enabling/disabling campaign |
| 560 | + if ( $wgRequest->getArray( 'enabled' ) ) { |
| 561 | + $this->updateEnabled( $notice, '1' ); |
| 562 | + } else { |
| 563 | + $this->updateEnabled( $notice, 0 ); |
| 564 | + } |
| 565 | + |
| 566 | + // Handle setting campaign to preferred/not preferred |
| 567 | + if ( $wgRequest->getArray( 'preferred' ) ) { |
| 568 | + $this->updatePreferred( $notice, '1' ); |
| 569 | + } else { |
| 570 | + $this->updatePreferred( $notice, 0 ); |
| 571 | + } |
| 572 | + |
| 573 | + // Handle updating the start and end settings |
| 574 | + $start = $wgRequest->getArray( 'start' ); |
| 575 | + $end = $wgRequest->getArray( 'end' ); |
| 576 | + if ( $start && $end ) { |
| 577 | + $updatedStart = sprintf( "%04d%02d%02d%02d%02d00", |
| 578 | + $start['year'], |
| 579 | + $start['month'], |
| 580 | + $start['day'], |
| 581 | + $start['hour'], |
| 582 | + $start['min'] ); |
| 583 | + $updatedEnd = sprintf( "%04d%02d%02d000000", |
| 584 | + $end['year'], |
| 585 | + $end['month'], |
| 586 | + $end['day'] ); |
| 587 | + $this->updateNoticeDate( $notice, $updatedStart, $updatedEnd ); |
| 588 | + } |
| 589 | + |
| 590 | + // Handle adding of banners to the campaign |
| 591 | + $templatesToAdd = $wgRequest->getArray( 'addTemplates' ); |
| 592 | + if ( $templatesToAdd ) { |
| 593 | + $weight = $wgRequest->getArray( 'weight' ); |
| 594 | + foreach ( $templatesToAdd as $templateName ) { |
| 595 | + $templateId = $this->getTemplateId( $templateName ); |
| 596 | + $this->addTemplateTo( $notice, $templateName, $weight[$templateId] ); |
| 597 | + } |
| 598 | + } |
604 | 599 | |
605 | | - // Check authentication token |
606 | | - if ( $wgUser->matchEditToken( $wgRequest->getVal( 'authtoken' ) ) ) { |
607 | | - |
608 | | - // Handle adding of banners to the campaign |
609 | | - $templatesToAdd = $wgRequest->getArray( 'addTemplates' ); |
610 | | - if ( isset( $templatesToAdd ) ) { |
611 | | - $weight = $wgRequest->getArray( 'weight' ); |
612 | | - foreach ( $templatesToAdd as $templateName ) { |
613 | | - $templateId = $this->getTemplateId( $templateName ); |
614 | | - $this->addTemplateTo( $notice, $templateName, $weight[$templateId] ); |
| 600 | + // Handle removing of banners from the campaign |
| 601 | + $templateToRemove = $wgRequest->getArray( 'removeTemplates' ); |
| 602 | + if ( $templateToRemove ) { |
| 603 | + foreach ( $templateToRemove as $template ) { |
| 604 | + $this->removeTemplateFor( $notice, $template ); |
| 605 | + } |
615 | 606 | } |
616 | | - } |
| 607 | + |
| 608 | + // Handle weight changes |
| 609 | + $updatedWeights = $wgRequest->getArray( 'weight' ); |
| 610 | + if ( $updatedWeights ) { |
| 611 | + foreach ( $updatedWeights as $templateId => $weight ) { |
| 612 | + $this->updateWeight( $notice, $templateId, $weight ); |
| 613 | + } |
| 614 | + } |
617 | 615 | |
618 | | - // Handle removing of banners from the campaign |
619 | | - $templateToRemove = $wgRequest->getArray( 'removeTemplates' ); |
620 | | - if ( isset( $templateToRemove ) ) { |
621 | | - foreach ( $templateToRemove as $template ) { |
622 | | - $this->removeTemplateFor( $notice, $template ); |
| 616 | + // Handle new project name |
| 617 | + $projectName = $wgRequest->getVal( 'project_name' ); |
| 618 | + if ( $projectName ) { |
| 619 | + $this->updateProjectName ( $notice, $projectName ); |
623 | 620 | } |
| 621 | + |
| 622 | + // Handle new project languages |
| 623 | + $projectLangs = $wgRequest->getArray( 'project_languages' ); |
| 624 | + if ( $projectLangs ) { |
| 625 | + $this->updateProjectLanguages( $notice, $projectLangs ); |
| 626 | + } |
| 627 | + |
| 628 | + // If there were no errors, reload the page to prevent duplicate form submission |
| 629 | + if ( !$this->centralNoticeError ) { |
| 630 | + $wgOut->redirect( $this->getTitle()->getLocalUrl( "method=listNoticeDetail¬ice=$notice" ) ); |
| 631 | + return; |
| 632 | + } |
| 633 | + } else { |
| 634 | + $this->showError( 'sessionfailure' ); |
624 | 635 | } |
625 | | - |
626 | | - // Handle new project name |
627 | | - $projectName = $wgRequest->getVal( 'project_name' ); |
628 | | - if ( isset( $projectName ) ) { |
629 | | - $this->updateProjectName ( $notice, $projectName ); |
630 | | - } |
631 | | - |
632 | | - // Handle new project languages |
633 | | - $projectLangs = $wgRequest->getArray( 'project_languages' ); |
634 | | - if ( isset( $projectLangs ) ) { |
635 | | - $this->updateProjectLanguages( $notice, $projectLangs ); |
636 | | - } |
637 | | - |
638 | | - $wgOut->redirect( $this->getTitle()->getLocalUrl( "method=listNoticeDetail¬ice=$notice" ) ); |
639 | | - return; |
640 | 636 | |
641 | | - } else { |
642 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'sessionfailure' ); |
643 | 637 | } |
644 | | - |
645 | | - } |
646 | 638 | |
647 | | - $noticeId = $this->getNoticeId( $notice ); |
648 | | - |
649 | | - // Make sure notice exists |
650 | | - if ( !$noticeId ) { |
651 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-notice-doesnt-exist' ); |
652 | | - } else { |
653 | 639 | $htmlOut = ''; |
654 | 640 | |
655 | 641 | // Begin Campaign detail fieldset |
— | — | @@ -753,15 +739,17 @@ |
754 | 740 | $endArray['month'] . |
755 | 741 | $endArray['day'] . '000000' |
756 | 742 | ; |
| 743 | + $isEnabled = $wgRequest->getCheck( 'enabled' ); |
| 744 | + $isPreferred = $wgRequest->getCheck( 'preferred' ); |
| 745 | + $isLocked = $wgRequest->getCheck( 'locked' ); |
757 | 746 | $projectSelected = $wgRequest->getVal( 'project_name' ); |
758 | | - if ( $wgRequest->getArray( 'project_languages' ) ) { |
759 | | - $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
760 | | - } else { |
761 | | - $noticeLanguages = array(); |
762 | | - } |
| 747 | + $noticeLanguages = $wgRequest->getArray( 'project_languages', array() ); |
763 | 748 | } else { // Defaults |
764 | 749 | $startTimestamp = $row->not_start; |
765 | 750 | $endTimestamp = $row->not_end; |
| 751 | + $isEnabled = ( $row->not_enabled == '1' ); |
| 752 | + $isPreferred = ( $row->not_preferred == '1' ); |
| 753 | + $isLocked = ( $row->not_locked == '1' ); |
766 | 754 | $projectSelected = $row->not_project; |
767 | 755 | $noticeLanguages = $this->getNoticeLanguages( $notice ); |
768 | 756 | } |
— | — | @@ -799,24 +787,24 @@ |
800 | 788 | $htmlOut .= Xml::closeElement( 'tr' ); |
801 | 789 | // Enabled |
802 | 790 | $htmlOut .= Xml::openElement( 'tr' ); |
803 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-enabled' ), 'enabled[]' ) ); |
804 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'enabled[]', ( $row->not_enabled == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'enabled[]' ) ) ) ); |
| 791 | + $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-enabled' ), 'enabled' ) ); |
| 792 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'enabled', $isEnabled, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'enabled' ) ) ) ); |
805 | 793 | $htmlOut .= Xml::closeElement( 'tr' ); |
806 | 794 | // Preferred |
807 | 795 | $htmlOut .= Xml::openElement( 'tr' ); |
808 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-preferred' ), 'preferred[]' ) ); |
809 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'preferred[]', ( $row->not_preferred == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'preferred[]' ) ) ) ); |
| 796 | + $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-preferred' ), 'preferred' ) ); |
| 797 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'preferred', $isPreferred, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'preferred' ) ) ) ); |
810 | 798 | $htmlOut .= Xml::closeElement( 'tr' ); |
811 | 799 | // Locked |
812 | 800 | $htmlOut .= Xml::openElement( 'tr' ); |
813 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-locked' ), 'locked[]' ) ); |
814 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'locked[]', ( $row->not_locked == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'locked[]' ) ) ) ); |
| 801 | + $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-locked' ), 'locked' ) ); |
| 802 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'locked', $isLocked, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'locked' ) ) ) ); |
815 | 803 | $htmlOut .= Xml::closeElement( 'tr' ); |
816 | 804 | if ( $this->editable ) { |
817 | 805 | // Locked |
818 | 806 | $htmlOut .= Xml::openElement( 'tr' ); |
819 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-remove' ), 'removeNotices[]' ) ); |
820 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'removeNotices[]', false, array( 'value' => $row->not_name, 'id' => 'removeNotices[]' ) ) ); |
| 807 | + $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-remove' ), 'remove' ) ); |
| 808 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'remove', false, array( 'value' => $row->not_name, 'id' => 'remove' ) ) ); |
821 | 809 | $htmlOut .= Xml::closeElement( 'tr' ); |
822 | 810 | } |
823 | 811 | $htmlOut .= Xml::closeElement( 'table' ); |
— | — | @@ -1008,13 +996,11 @@ |
1009 | 997 | function addNotice( $noticeName, $enabled, $start, $project_name, $project_languages ) { |
1010 | 998 | global $wgOut; |
1011 | 999 | |
1012 | | - $dbr = wfGetDB( DB_SLAVE ); |
1013 | | - $res = $dbr->select( 'cn_notices', 'not_name', array( 'not_name' => $noticeName ) ); |
1014 | | - if ( $dbr->numRows( $res ) > 0 ) { |
1015 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-notice-exists' ); |
| 1000 | + if ( $this->noticeExists( $noticeName ) ) { |
| 1001 | + $this->showError( 'centralnotice-notice-exists' ); |
1016 | 1002 | return; |
1017 | 1003 | } elseif ( empty( $project_languages ) ) { |
1018 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-no-language' ); |
| 1004 | + $this->showError( 'centralnotice-no-language' ); |
1019 | 1005 | return; |
1020 | 1006 | } else { |
1021 | 1007 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -1037,8 +1023,8 @@ |
1038 | 1024 | $res = $dbw->insert( 'cn_notices', |
1039 | 1025 | array( 'not_name' => $noticeName, |
1040 | 1026 | 'not_enabled' => $enabled, |
1041 | | - 'not_start' => $dbr->timestamp( $startTs ), |
1042 | | - 'not_end' => $dbr->timestamp( $endTs ), |
| 1027 | + 'not_start' => $dbw->timestamp( $startTs ), |
| 1028 | + 'not_end' => $dbw->timestamp( $endTs ), |
1043 | 1029 | 'not_project' => $project_name |
1044 | 1030 | ) |
1045 | 1031 | ); |
— | — | @@ -1064,22 +1050,22 @@ |
1065 | 1051 | array( 'not_name' => $noticeName ) |
1066 | 1052 | ); |
1067 | 1053 | if ( $dbr->numRows( $res ) < 1 ) { |
1068 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-remove-notice-doesnt-exist' ); |
1069 | | - return; |
| 1054 | + $this->showError( 'centralnotice-remove-notice-doesnt-exist' ); |
| 1055 | + return; |
1070 | 1056 | } |
1071 | 1057 | $row = $dbr->fetchObject( $res ); |
1072 | 1058 | if ( $row->not_locked == '1' ) { |
1073 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-notice-is-locked' ); |
1074 | | - return; |
| 1059 | + $this->showError( 'centralnotice-notice-is-locked' ); |
| 1060 | + return; |
1075 | 1061 | } else { |
1076 | | - $dbw = wfGetDB( DB_MASTER ); |
1077 | | - $dbw->begin(); |
1078 | | - $noticeId = htmlspecialchars( $this->getNoticeId( $noticeName ) ); |
1079 | | - $res = $dbw->delete( 'cn_assignments', array ( 'not_id' => $noticeId ) ); |
1080 | | - $res = $dbw->delete( 'cn_notices', array ( 'not_name' => $noticeName ) ); |
1081 | | - $res = $dbw->delete( 'cn_notice_languages', array ( 'nl_notice_id' => $noticeId ) ); |
1082 | | - $dbw->commit(); |
1083 | | - return; |
| 1062 | + $dbw = wfGetDB( DB_MASTER ); |
| 1063 | + $dbw->begin(); |
| 1064 | + $noticeId = htmlspecialchars( $this->getNoticeId( $noticeName ) ); |
| 1065 | + $res = $dbw->delete( 'cn_assignments', array ( 'not_id' => $noticeId ) ); |
| 1066 | + $res = $dbw->delete( 'cn_notices', array ( 'not_name' => $noticeName ) ); |
| 1067 | + $res = $dbw->delete( 'cn_notice_languages', array ( 'nl_notice_id' => $noticeId ) ); |
| 1068 | + $dbw->commit(); |
| 1069 | + return; |
1084 | 1070 | } |
1085 | 1071 | } |
1086 | 1072 | |
— | — | @@ -1098,7 +1084,7 @@ |
1099 | 1085 | ) |
1100 | 1086 | ); |
1101 | 1087 | if ( $dbr->numRows( $res ) > 0 ) { |
1102 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-template-already-exists' ); |
| 1088 | + $this->showError( 'centralnotice-template-already-exists' ); |
1103 | 1089 | } else { |
1104 | 1090 | $dbw = wfGetDB( DB_MASTER ); |
1105 | 1091 | $dbw->begin(); |
— | — | @@ -1124,7 +1110,7 @@ |
1125 | 1111 | if ( $row ) { |
1126 | 1112 | return $row->not_id; |
1127 | 1113 | } else { |
1128 | | - return; |
| 1114 | + return null; |
1129 | 1115 | } |
1130 | 1116 | } |
1131 | 1117 | |
— | — | @@ -1174,14 +1160,14 @@ |
1175 | 1161 | |
1176 | 1162 | // Start/end don't line up |
1177 | 1163 | if ( $start > $end || $end < $start ) { |
1178 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-invalid-date-range3' ); |
1179 | | - return; |
| 1164 | + $this->showError( 'centralnotice-invalid-date-range' ); |
| 1165 | + return; |
1180 | 1166 | } |
1181 | 1167 | |
1182 | 1168 | // Invalid campaign name |
1183 | | - $res = $dbr->select( 'cn_notices', 'not_name', array( 'not_name' => $noticeName ) ); |
1184 | | - if ( $dbr->numRows( $res ) < 1 ) { |
1185 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-notice-doesnt-exist' ); |
| 1169 | + if ( !$this->noticeExists( $noticeName ) ) { |
| 1170 | + $this->showError( 'centralnotice-notice-doesnt-exist' ); |
| 1171 | + return; |
1186 | 1172 | } |
1187 | 1173 | |
1188 | 1174 | // Overlap over a date within the same project and language |
— | — | @@ -1189,7 +1175,6 @@ |
1190 | 1176 | $endDate = $dbr->timestamp( $end ); |
1191 | 1177 | |
1192 | 1178 | $dbw = wfGetDB( DB_MASTER ); |
1193 | | - $dbw->begin(); |
1194 | 1179 | $res = $dbw->update( 'cn_notices', |
1195 | 1180 | array( |
1196 | 1181 | 'not_start' => $startDate, |
— | — | @@ -1197,26 +1182,56 @@ |
1198 | 1183 | ), |
1199 | 1184 | array( 'not_name' => $noticeName ) |
1200 | 1185 | ); |
1201 | | - $dbw->commit(); |
1202 | 1186 | } |
1203 | 1187 | |
| 1188 | + /** |
| 1189 | + * Update the enabled/disabled state of a campaign |
| 1190 | + */ |
| 1191 | + private function updateEnabled( $noticeName, $isEnabled ) { |
| 1192 | + global $wgOut; |
| 1193 | + |
| 1194 | + if ( !$this->noticeExists( $noticeName ) ) { |
| 1195 | + $this->showError( 'centralnotice-doesnt-exist' ); |
| 1196 | + } else { |
| 1197 | + $dbw = wfGetDB( DB_MASTER ); |
| 1198 | + $res = $dbw->update( 'cn_notices', |
| 1199 | + array( 'not_enabled' => $isEnabled ), |
| 1200 | + array( 'not_name' => $noticeName ) |
| 1201 | + ); |
| 1202 | + } |
| 1203 | + } |
| 1204 | + |
| 1205 | + /** |
| 1206 | + * Update the preferred/not preferred state of a campaign |
| 1207 | + */ |
| 1208 | + function updatePreferred( $noticeName, $isPreferred ) { |
| 1209 | + global $wgOut; |
| 1210 | + |
| 1211 | + if ( !$this->noticeExists( $noticeName ) ) { |
| 1212 | + $this->showError( 'centralnotice-doesnt-exist' ); |
| 1213 | + } else { |
| 1214 | + $dbw = wfGetDB( DB_MASTER ); |
| 1215 | + $res = $dbw->update( 'cn_notices', |
| 1216 | + array( 'not_preferred' => $isPreferred ), |
| 1217 | + array( 'not_name' => $noticeName ) |
| 1218 | + ); |
| 1219 | + } |
| 1220 | + } |
| 1221 | + |
| 1222 | + /** |
| 1223 | + * Update the locked/unlocked state of a campaign |
| 1224 | + */ |
1204 | 1225 | function updateLock( $noticeName, $isLocked ) { |
1205 | 1226 | global $wgOut; |
1206 | 1227 | |
1207 | | - $dbr = wfGetDB( DB_SLAVE ); |
1208 | | - $res = $dbr->select( 'cn_notices', 'not_name', |
1209 | | - array( 'not_name' => $noticeName ) |
1210 | | - ); |
1211 | | - if ( $dbr->numRows( $res ) < 1 ) { |
1212 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-doesnt-exist' ); |
| 1228 | + if ( !$this->noticeExists( $noticeName ) ) { |
| 1229 | + $this->showError( 'centralnotice-doesnt-exist' ); |
1213 | 1230 | } else { |
1214 | 1231 | $dbw = wfGetDB( DB_MASTER ); |
1215 | | - $dbw->begin(); |
1216 | 1232 | $res = $dbw->update( 'cn_notices', |
1217 | 1233 | array( 'not_locked' => $isLocked ), |
1218 | 1234 | array( 'not_name' => $noticeName ) |
1219 | 1235 | ); |
1220 | | - $dbw->commit(); |
1221 | 1236 | } |
1222 | 1237 | } |
1223 | 1238 | |
— | — | @@ -1305,14 +1320,12 @@ |
1306 | 1321 | |
1307 | 1322 | function updateProjectName( $notice, $projectName ) { |
1308 | 1323 | $dbw = wfGetDB( DB_MASTER ); |
1309 | | - $dbw->begin(); |
1310 | 1324 | $res = $dbw->update( 'cn_notices', |
1311 | 1325 | array ( 'not_project' => $projectName ), |
1312 | 1326 | array( |
1313 | 1327 | 'not_name' => $notice |
1314 | 1328 | ) |
1315 | 1329 | ); |
1316 | | - $dbw->commit(); |
1317 | 1330 | } |
1318 | 1331 | |
1319 | 1332 | function updateProjectLanguages( $notice, $newLanguages ) { |
— | — | @@ -1344,6 +1357,17 @@ |
1345 | 1358 | |
1346 | 1359 | $dbw->commit(); |
1347 | 1360 | } |
| 1361 | + |
| 1362 | + public static function noticeExists( $noticeName ) { |
| 1363 | + $dbr = wfGetDB( DB_SLAVE ); |
| 1364 | + $eNoticeName = htmlspecialchars( $noticeName ); |
| 1365 | + $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_name' => $eNoticeName ) ); |
| 1366 | + if ( $row ) { |
| 1367 | + return true; |
| 1368 | + } else { |
| 1369 | + return false; |
| 1370 | + } |
| 1371 | + } |
1348 | 1372 | |
1349 | 1373 | public static function dropDownList( $text, $values ) { |
1350 | 1374 | $dropDown = "* {$text}\n"; |
— | — | @@ -1360,6 +1384,12 @@ |
1361 | 1385 | } |
1362 | 1386 | return $text; |
1363 | 1387 | } |
| 1388 | + |
| 1389 | + function showError( $message ) { |
| 1390 | + global $wgOut; |
| 1391 | + $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", $message ); |
| 1392 | + $this->centralNoticeError = true; |
| 1393 | + } |
1364 | 1394 | } |
1365 | 1395 | |
1366 | 1396 | |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.i18n.php |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | 'centralnotice-template-already-exists' => 'Banner is already tied to campaign. |
81 | 81 | Not adding.', |
82 | 82 | 'centralnotice-preview-template' => 'Preview banner', |
83 | | - 'centralnotice-start-hour' => 'Start time (GMT)', |
| 83 | + 'centralnotice-start-hour' => 'Start time (UTC)', |
84 | 84 | 'centralnotice-change-lang' => 'Change translation language', |
85 | 85 | 'centralnotice-weights' => 'Weights', |
86 | 86 | 'centralnotice-notice-is-locked' => 'Campaign is locked. |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | {{Identical|Start date}}', |
167 | 167 | 'centralnotice-start-time' => 'Used in Special:CentralNotice', |
168 | 168 | 'centralnotice-available-templates' => 'Used in Special:NoticeTemplate', |
| 169 | + 'centralnotice-start-hour' => 'UTC is "[http://en.wikipedia.org/wiki/Coordinated_Universal_Time Coordinated Universal Time]".', |
169 | 170 | 'centralnotice-notice-is-locked' => 'Error message displayed in Special:CentralNotice when trying to delete a locked notice', |
170 | 171 | 'centralnotice-invalid-date-range' => '{{Identical|Date}}', |
171 | 172 | 'centralnotice-no-notices-exist' => 'Used in Special:CentralNotice when there are no notices', |
— | — | @@ -240,7 +241,7 @@ |
241 | 242 | 'centralnotice-template-already-exists' => 'Die sjabloon is reeds aan \'n "campaign" gekoppel. |
242 | 243 | Word nie bygevoeg nie', |
243 | 244 | 'centralnotice-preview-template' => 'Voorskou sjabloon', |
244 | | - 'centralnotice-start-hour' => 'Begintyd', |
| 245 | + 'centralnotice-start-hour' => 'Begintyd (UTC)', |
245 | 246 | 'centralnotice-change-lang' => 'Verander taal vir vertaling', |
246 | 247 | 'centralnotice-weights' => 'Gewigte', |
247 | 248 | 'centralnotice-notice-is-locked' => 'Kennisgewing is gesluit. |
— | — | @@ -644,7 +645,7 @@ |
645 | 646 | 'centralnotice-template-already-exists' => 'Паведамленьне ужо выкарыстоўваецца ў кампаніі. |
646 | 647 | Не дададзенае.', |
647 | 648 | 'centralnotice-preview-template' => 'Папярэдні прагляд паведамленьня', |
648 | | - 'centralnotice-start-hour' => 'Час пачатку (GMT)', |
| 649 | + 'centralnotice-start-hour' => 'Час пачатку (UTC)', |
649 | 650 | 'centralnotice-change-lang' => 'Зьмяніць мову перакладу', |
650 | 651 | 'centralnotice-weights' => 'Вагі', |
651 | 652 | 'centralnotice-notice-is-locked' => 'Кампанія заблякаванае. |
— | — | @@ -905,7 +906,7 @@ |
906 | 907 | 'centralnotice-template-already-exists' => "Liammet eo c'hoazh ar patrom gant ur c'houlzad. |
907 | 908 | N'eo ket bet ouzhpennet.", |
908 | 909 | 'centralnotice-preview-template' => 'Rakwelet ar patrom', |
909 | | - 'centralnotice-start-hour' => 'Eurvezh kregiñ (GMT)', |
| 910 | + 'centralnotice-start-hour' => 'Eurvezh kregiñ (UTC)', |
910 | 911 | 'centralnotice-change-lang' => 'Cheñch yezh an droidigezh', |
911 | 912 | 'centralnotice-weights' => 'Pouezioù', |
912 | 913 | 'centralnotice-notice-is-locked' => "Prenet eo an ali. |
— | — | @@ -975,7 +976,8 @@ |
976 | 977 | 'centralnotice-translate-to' => 'Prevedi na', |
977 | 978 | 'centralnotice-translate' => 'Prijevod', |
978 | 979 | 'centralnotice-english' => 'engleski jezik', |
979 | | - 'centralnotice-banner-name' => 'Naslov šablona', |
| 980 | + 'centralnotice-banner-name' => 'Naslov banera:', |
| 981 | + 'centralnotice-banner' => 'Baner', |
980 | 982 | 'centralnotice-templates' => 'Šabloni', |
981 | 983 | 'centralnotice-weight' => 'Težina', |
982 | 984 | 'centralnotice-locked' => 'Zaključano', |
— | — | @@ -995,6 +997,7 @@ |
996 | 998 | 'centralnotice-hours' => 'sat', |
997 | 999 | 'centralnotice-min' => 'minut', |
998 | 1000 | 'centralnotice-project-lang' => 'Jezik projekta', |
| 1001 | + 'centralnotice-top-ten-languages' => 'Najboljih 10 jezika', |
999 | 1002 | 'centralnotice-project-name' => 'Naslov projekta', |
1000 | 1003 | 'centralnotice-start-date' => 'Početni datum', |
1001 | 1004 | 'centralnotice-start-time' => 'Početno vrijeme (UTC)', |
— | — | @@ -1024,6 +1027,7 @@ |
1025 | 1028 | Dodaj jednu ispod', |
1026 | 1029 | 'centralnotice-no-templates-translate' => 'Nema ni jednog šablona za uređivanje prijevoda', |
1027 | 1030 | 'centralnotice-number-uses' => 'Upotreba', |
| 1031 | + 'centralnotice-settings' => 'Postavke', |
1028 | 1032 | 'centralnotice-edit-template' => 'Uredi šablon', |
1029 | 1033 | 'centralnotice-message' => 'Poruka', |
1030 | 1034 | 'centralnotice-message-not-set' => 'Poruka nije postavljena', |
— | — | @@ -1173,7 +1177,7 @@ |
1174 | 1178 | 'centralnotice-translate-to' => 'Přeložit do jazyka', |
1175 | 1179 | 'centralnotice-translate' => 'Přeložit', |
1176 | 1180 | 'centralnotice-english' => 'Anglicky', |
1177 | | - 'centralnotice-banner-name' => 'Název šablony', |
| 1181 | + 'centralnotice-banner-name' => 'Název banneru:', |
1178 | 1182 | 'centralnotice-banner' => 'Banner', |
1179 | 1183 | 'centralnotice-banner-heading' => 'Banner: $1', |
1180 | 1184 | 'centralnotice-templates' => 'Šablony', |
— | — | @@ -1208,7 +1212,7 @@ |
1209 | 1213 | 'centralnotice-template-already-exists' => 'Šablona už byla s kampaní svázána. |
1210 | 1214 | Nebude přidána.', |
1211 | 1215 | 'centralnotice-preview-template' => 'Náhled šablony', |
1212 | | - 'centralnotice-start-hour' => 'Čas začátku (GMT)', |
| 1216 | + 'centralnotice-start-hour' => 'Čas začátku (UTC)', |
1213 | 1217 | 'centralnotice-change-lang' => 'Změnit překládaný jazyk', |
1214 | 1218 | 'centralnotice-weights' => 'Váhy', |
1215 | 1219 | 'centralnotice-notice-is-locked' => 'Oznámení je uzamčeno. Nebude odstraněno.', |
— | — | @@ -1221,6 +1225,7 @@ |
1222 | 1226 | Níže můžete vytvořit nové.', |
1223 | 1227 | 'centralnotice-no-templates-translate' => 'Nejsou žádné šablony, které by šlo přeložit', |
1224 | 1228 | 'centralnotice-number-uses' => 'Použití', |
| 1229 | + 'centralnotice-settings' => 'Nastavení', |
1225 | 1230 | 'centralnotice-edit-template' => 'Upravit šablonu', |
1226 | 1231 | 'centralnotice-edit-template-summary' => 'Lokalizovatelnou zprávu vytvoříte uzavřením identifikátoru se spojovníky do složených závorek, např. {{{citát-jimbo}}}.', |
1227 | 1232 | 'centralnotice-message' => 'Zpráva', |
— | — | @@ -1279,7 +1284,7 @@ |
1280 | 1285 | 'centralnotice-translate-to' => "Cyfieithu i'r", |
1281 | 1286 | 'centralnotice-translate' => 'Cyfieithu', |
1282 | 1287 | 'centralnotice-english' => 'Saesneg', |
1283 | | - 'centralnotice-banner-name' => "Enw'r nodyn", |
| 1288 | + 'centralnotice-banner-name' => "Enw'r faner:", |
1284 | 1289 | 'centralnotice-templates' => 'Nodiadau', |
1285 | 1290 | 'centralnotice-weight' => 'Pwys', |
1286 | 1291 | 'centralnotice-locked' => 'Ar glo', |
— | — | @@ -1289,9 +1294,9 @@ |
1290 | 1295 | 'centralnotice-template-exists' => "Mae'r faner yn bodoli'n barod. |
1291 | 1296 | Ddim yn ychwanegu", |
1292 | 1297 | 'centralnotice-notice-doesnt-exist' => "Nid yw'r ymgyrch i gael.", |
1293 | | - 'centralnotice-template-still-bound' => "Mae'r faner yn perthyn i ymgyrch o hyd. |
1294 | | -Ddim yn tynnu.", |
1295 | | - 'centralnotice-template-body' => 'Corff y faner:', |
| 1298 | + 'centralnotice-template-still-bound' => "Mae'r faner yn dal i fod ynghlwm wrth ymgyrch. |
| 1299 | +Ddim yn tynnu i ffwrdd.", |
| 1300 | + 'centralnotice-template-body' => 'Testun y faner:', |
1296 | 1301 | 'centralnotice-day' => 'Dydd', |
1297 | 1302 | 'centralnotice-year' => 'Blwyddyn', |
1298 | 1303 | 'centralnotice-month' => 'Mis', |
— | — | @@ -1302,8 +1307,8 @@ |
1303 | 1308 | 'centralnotice-start-date' => 'Dyddiad cychwyn', |
1304 | 1309 | 'centralnotice-start-time' => 'Amser cychwyn (UTC)', |
1305 | 1310 | 'centralnotice-no-templates' => 'Ni chanfuwyd unrhyw faner. |
1306 | | -Ychwanegu rhai!', |
1307 | | - 'centralnotice-start-hour' => 'Amser dechrau', |
| 1311 | +Ychwanegwch rai!', |
| 1312 | + 'centralnotice-start-hour' => 'Amser dechrau (UTC)', |
1308 | 1313 | 'centralnotice-weights' => 'Pwysau', |
1309 | 1314 | 'centralnotice-notice-is-locked' => "Mae'r hysbysiad wedi ei gloi. |
1310 | 1315 | Ni chaiff ei dynnu i ffwrdd", |
— | — | @@ -1311,6 +1316,8 @@ |
1312 | 1317 | Gallwch ychwanegu un isod.', |
1313 | 1318 | 'centralnotice-edit-template' => "Golygu'r nodyn", |
1314 | 1319 | 'centralnotice-message' => 'Neges', |
| 1320 | + 'centralnotice-clone-name' => 'Enw:', |
| 1321 | + 'centralnotice-banner-anonymous' => 'Defnyddwyr anhysbys', |
1315 | 1322 | 'right-centralnotice-admin' => 'Gweinyddu hysbysiadau canolog', |
1316 | 1323 | 'right-centralnotice-translate' => 'Cyfieithu hysbysiadau canolog', |
1317 | 1324 | 'action-centralnotice-admin' => 'gweinyddu hysbysiadau canolog', |
— | — | @@ -1327,7 +1334,7 @@ |
1328 | 1335 | 'centralnotice-preview' => 'Forhåndsvisning', |
1329 | 1336 | 'centralnotice-add' => 'Tilføj', |
1330 | 1337 | 'centralnotice-english' => 'Engelsk', |
1331 | | - 'centralnotice-banner-name' => 'Skabelonnavn', |
| 1338 | + 'centralnotice-banner-name' => 'Bannernavn:', |
1332 | 1339 | 'centralnotice-templates' => 'Skabeloner', |
1333 | 1340 | 'centralnotice-locked' => 'Låst', |
1334 | 1341 | 'centralnotice-day' => 'Dag', |
— | — | @@ -1382,7 +1389,7 @@ |
1383 | 1390 | 'centralnotice-translate-to' => 'Übersetzen in', |
1384 | 1391 | 'centralnotice-translate' => 'Übersetzen', |
1385 | 1392 | 'centralnotice-english' => 'Englisch', |
1386 | | - 'centralnotice-banner-name' => 'Name der Vorlage', |
| 1393 | + 'centralnotice-banner-name' => 'Name der Vorlage:', |
1387 | 1394 | 'centralnotice-banner' => 'Vorlage', |
1388 | 1395 | 'centralnotice-banner-heading' => 'Vorlage: $1', |
1389 | 1396 | 'centralnotice-templates' => 'Vorlagen', |
— | — | @@ -1422,7 +1429,7 @@ |
1423 | 1430 | 'centralnotice-template-already-exists' => 'Vorlage ist bereits mit der Meldung verbunden. |
1424 | 1431 | Sie wird daher nicht hinzugefügt.', |
1425 | 1432 | 'centralnotice-preview-template' => 'Vorschau Vorlage', |
1426 | | - 'centralnotice-start-hour' => 'Startzeit (GMT)', |
| 1433 | + 'centralnotice-start-hour' => 'Startzeit (UTC)', |
1427 | 1434 | 'centralnotice-change-lang' => 'Übersetzungssprache ändern', |
1428 | 1435 | 'centralnotice-weights' => 'Gewicht', |
1429 | 1436 | 'centralnotice-notice-is-locked' => 'Meldung ist gesperrt. |
— | — | @@ -1642,7 +1649,7 @@ |
1643 | 1650 | 'centralnotice-template-already-exists' => 'Pśedłoga jo južo z kampanju zwězana. |
1644 | 1651 | Žedno pśidaśe', |
1645 | 1652 | 'centralnotice-preview-template' => 'Pśeglěd pśedłogi', |
1646 | | - 'centralnotice-start-hour' => 'Startowy cas (GMT)', |
| 1653 | + 'centralnotice-start-hour' => 'Startowy cas (UTC)', |
1647 | 1654 | 'centralnotice-change-lang' => 'Pśełožkowu rěc změniś', |
1648 | 1655 | 'centralnotice-weights' => 'Wagi', |
1649 | 1656 | 'centralnotice-notice-is-locked' => 'Powěźeńka jo zastajona. |
— | — | @@ -2202,7 +2209,7 @@ |
2203 | 2210 | 'centralnotice-translate-to' => 'ترجمه به', |
2204 | 2211 | 'centralnotice-translate' => 'ترجمه کردن', |
2205 | 2212 | 'centralnotice-english' => 'انگلیسی', |
2206 | | - 'centralnotice-banner-name' => 'نام الگو', |
| 2213 | + 'centralnotice-banner-name' => 'نام پرچم:', |
2207 | 2214 | 'centralnotice-banner' => 'پرچم', |
2208 | 2215 | 'centralnotice-banner-heading' => 'پرچم: $1', |
2209 | 2216 | 'centralnotice-templates' => 'الگوها', |
— | — | @@ -2242,7 +2249,7 @@ |
2243 | 2250 | 'centralnotice-template-already-exists' => 'الگو از قبل به اعلان گره خورده است. |
2244 | 2251 | افزوده نشد', |
2245 | 2252 | 'centralnotice-preview-template' => 'الگو نمایش', |
2246 | | - 'centralnotice-start-hour' => 'زمان شروع (GMT)', |
| 2253 | + 'centralnotice-start-hour' => 'زمان شروع (UTC)', |
2247 | 2254 | 'centralnotice-change-lang' => 'تغییر زبان ترجمه', |
2248 | 2255 | 'centralnotice-weights' => 'وزنها', |
2249 | 2256 | 'centralnotice-notice-is-locked' => 'اعلان قفل شدهاست. |
— | — | @@ -2425,7 +2432,7 @@ |
2426 | 2433 | 'centralnotice-translate-to' => 'Traduire en', |
2427 | 2434 | 'centralnotice-translate' => 'Traduire', |
2428 | 2435 | 'centralnotice-english' => 'anglais', |
2429 | | - 'centralnotice-banner-name' => 'Nom du modèle', |
| 2436 | + 'centralnotice-banner-name' => 'Nom de la bannière :', |
2430 | 2437 | 'centralnotice-banner' => 'Bannière', |
2431 | 2438 | 'centralnotice-banner-heading' => 'Bannière : $1', |
2432 | 2439 | 'centralnotice-templates' => 'Modèles', |
— | — | @@ -2465,7 +2472,7 @@ |
2466 | 2473 | 'centralnotice-template-already-exists' => 'Le modèle est déjà attaché à une campagne. |
2467 | 2474 | Il n’a pas été ajouté.', |
2468 | 2475 | 'centralnotice-preview-template' => 'Prévisualiser le modèle', |
2469 | | - 'centralnotice-start-hour' => 'Heure de départ (GMT)', |
| 2476 | + 'centralnotice-start-hour' => 'Heure de départ (UTC)', |
2470 | 2477 | 'centralnotice-change-lang' => 'Modifier la langue de traduction', |
2471 | 2478 | 'centralnotice-weights' => 'Poids', |
2472 | 2479 | 'centralnotice-notice-is-locked' => 'L’avis est verrouillé. |
— | — | @@ -2482,6 +2489,7 @@ |
2483 | 2490 | Ajoutez-en ci-dessous.', |
2484 | 2491 | 'centralnotice-no-templates-translate' => 'Il n’y a aucun modèle à traduire', |
2485 | 2492 | 'centralnotice-number-uses' => 'Utilisations', |
| 2493 | + 'centralnotice-settings' => 'Paramètres', |
2486 | 2494 | 'centralnotice-edit-template' => 'Modifier le modèle', |
2487 | 2495 | 'centralnotice-edit-template-summary' => 'Pour créer un message localisable, entourez une chaîne à trait d’union de trois accolades, par exemple {{{jimbo-quote}}}.', |
2488 | 2496 | 'centralnotice-message' => 'Message', |
— | — | @@ -2542,7 +2550,7 @@ |
2543 | 2551 | 'centralnotice-translate-to' => 'Traduire en', |
2544 | 2552 | 'centralnotice-translate' => 'Traduire', |
2545 | 2553 | 'centralnotice-english' => 'Anglès', |
2546 | | - 'centralnotice-banner-name' => 'Nom du modèlo', |
| 2554 | + 'centralnotice-banner-name' => 'Nom du modèlo :', |
2547 | 2555 | 'centralnotice-banner' => 'Modèlo', |
2548 | 2556 | 'centralnotice-banner-heading' => 'Modèlo : $1', |
2549 | 2557 | 'centralnotice-templates' => 'Modèlos', |
— | — | @@ -2614,7 +2622,7 @@ |
2615 | 2623 | 'centralnotice-donate-button' => 'Boton de donacion', |
2616 | 2624 | 'centralnotice-expanded-banner' => 'Modèlo ètendu', |
2617 | 2625 | 'centralnotice-collapsed-banner' => 'Modèlo rèduit', |
2618 | | - 'centralnotice-banner-type' => 'Tipo de modèlo:', |
| 2626 | + 'centralnotice-banner-type' => 'Tipo de modèlo :', |
2619 | 2627 | 'centralnotice-banner-hidable' => 'Statico / cachâblo', |
2620 | 2628 | 'centralnotice-banner-collapsible' => 'Rèductiblo', |
2621 | 2629 | 'right-centralnotice-admin' => 'Administrar los avis centrâls', |
— | — | @@ -2663,7 +2671,7 @@ |
2664 | 2672 | 'centralnotice-translate-to' => 'Traducir ao', |
2665 | 2673 | 'centralnotice-translate' => 'Traducir', |
2666 | 2674 | 'centralnotice-english' => 'inglés', |
2667 | | - 'centralnotice-banner-name' => 'Nome do modelo', |
| 2675 | + 'centralnotice-banner-name' => 'Nome do modelo:', |
2668 | 2676 | 'centralnotice-banner' => 'Cartel', |
2669 | 2677 | 'centralnotice-banner-heading' => 'Cartel: $1', |
2670 | 2678 | 'centralnotice-templates' => 'Modelos', |
— | — | @@ -2703,7 +2711,7 @@ |
2704 | 2712 | 'centralnotice-template-already-exists' => 'O modelo xa está atado á campaña. |
2705 | 2713 | Non se engade', |
2706 | 2714 | 'centralnotice-preview-template' => 'Vista previa do modelo', |
2707 | | - 'centralnotice-start-hour' => 'Hora de inicio (GMT)', |
| 2715 | + 'centralnotice-start-hour' => 'Hora de inicio (UTC)', |
2708 | 2716 | 'centralnotice-change-lang' => 'Cambiar a lingua de tradución', |
2709 | 2717 | 'centralnotice-weights' => 'Pesos', |
2710 | 2718 | 'centralnotice-notice-is-locked' => 'O aviso está bloqueado. |
— | — | @@ -2807,7 +2815,7 @@ |
2808 | 2816 | 'centralnotice-translate-to' => 'Ibersetze in', |
2809 | 2817 | 'centralnotice-translate' => 'Ibersetze', |
2810 | 2818 | 'centralnotice-english' => 'Änglisch', |
2811 | | - 'centralnotice-banner-name' => 'Name vu dr Vorlag', |
| 2819 | + 'centralnotice-banner-name' => 'Bannername:', |
2812 | 2820 | 'centralnotice-banner' => 'Banner', |
2813 | 2821 | 'centralnotice-banner-heading' => 'Banner: $1', |
2814 | 2822 | 'centralnotice-templates' => 'Vorlage', |
— | — | @@ -2994,6 +3002,7 @@ |
2995 | 3003 | /** Croatian (Hrvatski) |
2996 | 3004 | * @author Dalibor Bosits |
2997 | 3005 | * @author Ex13 |
| 3006 | + * @author SpeedyGonsales |
2998 | 3007 | */ |
2999 | 3008 | $messages['hr'] = array( |
3000 | 3009 | 'centralnotice' => 'Administracija središnjih obavijesti', |
— | — | @@ -3006,24 +3015,32 @@ |
3007 | 3016 | 'centralnotice-end-date' => 'Završni datum', |
3008 | 3017 | 'centralnotice-enabled' => 'Omogućeno', |
3009 | 3018 | 'centralnotice-modify' => 'Postavi', |
| 3019 | + 'centralnotice-save-banner' => 'Spremi poruku', |
3010 | 3020 | 'centralnotice-preview' => 'Pregledaj', |
3011 | 3021 | 'centralnotice-add-new' => 'Dodaj novu središnju obavijest', |
3012 | 3022 | 'centralnotice-remove' => 'Ukloni', |
3013 | 3023 | 'centralnotice-translate-heading' => 'Prijevod za $1', |
3014 | 3024 | 'centralnotice-manage' => 'Uredi središnje obavijesti', |
| 3025 | + 'centralnotice-manage-templates' => 'Upravljanje porukama', |
3015 | 3026 | 'centralnotice-add' => 'Dodaj', |
3016 | 3027 | 'centralnotice-add-notice' => 'Dodaj obavijest', |
| 3028 | + 'centralnotice-edit-notice' => 'Uredi poruku', |
3017 | 3029 | 'centralnotice-add-template' => 'Dodaj predložak', |
3018 | 3030 | 'centralnotice-show-notices' => 'Pokaži obavijesti', |
3019 | 3031 | 'centralnotice-list-templates' => 'Popis predložaka', |
| 3032 | + 'centralnotice-multiple_languages' => 'više ($1)', |
3020 | 3033 | 'centralnotice-translations' => 'Prijevodi', |
3021 | 3034 | 'centralnotice-translate-to' => 'Prevedi na', |
3022 | 3035 | 'centralnotice-translate' => 'Prevedi', |
3023 | 3036 | 'centralnotice-english' => 'Engleski', |
3024 | | - 'centralnotice-banner-name' => 'Naziv predloška', |
| 3037 | + 'centralnotice-banner-name' => 'Naziv poruke:', |
| 3038 | + 'centralnotice-banner' => 'Poruka', |
| 3039 | + 'centralnotice-banner-heading' => 'Poruka: $1', |
3025 | 3040 | 'centralnotice-templates' => 'Predlošci', |
3026 | 3041 | 'centralnotice-weight' => 'Težina', |
3027 | 3042 | 'centralnotice-locked' => 'Zaključano', |
| 3043 | + 'centralnotice-notice' => 'Promidžba', |
| 3044 | + 'centralnotice-notice-heading' => 'Promidžba: $1', |
3028 | 3045 | 'centralnotice-notices' => 'Obavijesti', |
3029 | 3046 | 'centralnotice-notice-exists' => 'Obavijest već postoji. |
3030 | 3047 | Nije dodano', |
— | — | @@ -3154,7 +3171,7 @@ |
3155 | 3172 | 'centralnotice-template-already-exists' => 'Předłoha je hižo z kampanju zwjazana. |
3156 | 3173 | Njepřidawa so', |
3157 | 3174 | 'centralnotice-preview-template' => 'Přehlad předłohi', |
3158 | | - 'centralnotice-start-hour' => 'Startowy čas (GMT)', |
| 3175 | + 'centralnotice-start-hour' => 'Startowy čas (UTC)', |
3159 | 3176 | 'centralnotice-change-lang' => 'Přełožowansku rěč změnić', |
3160 | 3177 | 'centralnotice-weights' => 'Wahi', |
3161 | 3178 | 'centralnotice-notice-is-locked' => 'Powěsć je zawrjena. |
— | — | @@ -3322,7 +3339,7 @@ |
3323 | 3340 | 'centralnotice-translate-to' => 'Traducer in', |
3324 | 3341 | 'centralnotice-translate' => 'Traducer', |
3325 | 3342 | 'centralnotice-english' => 'Anglese', |
3326 | | - 'centralnotice-banner-name' => 'Nomine del bandiera', |
| 3343 | + 'centralnotice-banner-name' => 'Nomine del bandiera:', |
3327 | 3344 | 'centralnotice-banner' => 'Bandiera', |
3328 | 3345 | 'centralnotice-banner-heading' => 'Bandiera: $1', |
3329 | 3346 | 'centralnotice-templates' => 'Bandieras', |
— | — | @@ -3362,7 +3379,7 @@ |
3363 | 3380 | 'centralnotice-template-already-exists' => 'Le bandiera es ja ligate a un campania. |
3364 | 3381 | Non es addite.', |
3365 | 3382 | 'centralnotice-preview-template' => 'Previsualisar bandiera', |
3366 | | - 'centralnotice-start-hour' => 'Hora de initio (GMT)', |
| 3383 | + 'centralnotice-start-hour' => 'Hora de initio (UTC)', |
3367 | 3384 | 'centralnotice-change-lang' => 'Cambiar lingua de traduction', |
3368 | 3385 | 'centralnotice-weights' => 'Pesos', |
3369 | 3386 | 'centralnotice-notice-is-locked' => 'Le campania es serrate. |
— | — | @@ -3379,6 +3396,7 @@ |
3380 | 3397 | Adde un hic infra.', |
3381 | 3398 | 'centralnotice-no-templates-translate' => 'Non existe bandieras pro le quales modificar traductiones.', |
3382 | 3399 | 'centralnotice-number-uses' => 'Usos', |
| 3400 | + 'centralnotice-settings' => 'Configurationes', |
3383 | 3401 | 'centralnotice-edit-template' => 'Modificar bandiera', |
3384 | 3402 | 'centralnotice-edit-template-summary' => 'Pro crear un message localisabile, include un texto con tracto de union in tres accolladas, p.ex. {{{jimbo-quote}}}.', |
3385 | 3403 | 'centralnotice-message' => 'Message', |
— | — | @@ -3444,7 +3462,7 @@ |
3445 | 3463 | 'centralnotice-translate-to' => 'Terjemahkan ke', |
3446 | 3464 | 'centralnotice-translate' => 'Terjemahkan', |
3447 | 3465 | 'centralnotice-english' => 'Bahasa Inggris', |
3448 | | - 'centralnotice-banner-name' => 'Nama templat', |
| 3466 | + 'centralnotice-banner-name' => 'Nama templat:', |
3449 | 3467 | 'centralnotice-banner' => 'Spanduk', |
3450 | 3468 | 'centralnotice-banner-heading' => 'Panji: $1', |
3451 | 3469 | 'centralnotice-templates' => 'Templat', |
— | — | @@ -3484,7 +3502,7 @@ |
3485 | 3503 | 'centralnotice-template-already-exists' => 'Templat sudah digunakan dalam kampanye. |
3486 | 3504 | Batal menambahkan', |
3487 | 3505 | 'centralnotice-preview-template' => 'Lihat pratayang templat', |
3488 | | - 'centralnotice-start-hour' => 'Waktu mulai (GMT)', |
| 3506 | + 'centralnotice-start-hour' => 'Waktu mulai (UTC)', |
3489 | 3507 | 'centralnotice-change-lang' => 'Ubah bahasa terjemahan', |
3490 | 3508 | 'centralnotice-weights' => 'Bobot', |
3491 | 3509 | 'centralnotice-notice-is-locked' => 'Pengumuman terkunci. |
— | — | @@ -3501,6 +3519,7 @@ |
3502 | 3520 | Tambahkan di bawah ini.', |
3503 | 3521 | 'centralnotice-no-templates-translate' => 'Tidak ada templat yang dapat diterjemahkan', |
3504 | 3522 | 'centralnotice-number-uses' => 'Menggunakan', |
| 3523 | + 'centralnotice-settings' => 'Pengaturan', |
3505 | 3524 | 'centralnotice-edit-template' => 'Sunting templat', |
3506 | 3525 | 'centralnotice-edit-template-summary' => 'Untuk membuat dilokalisasi pesan, sertakan string ditulis dengan tanda penghubung di tiga kurung, misalnya {{{jimbo-quote}}}.', |
3507 | 3526 | 'centralnotice-message' => 'Pesan', |
— | — | @@ -3699,7 +3718,7 @@ |
3700 | 3719 | 'centralnotice-translate-to' => '翻訳先', |
3701 | 3720 | 'centralnotice-translate' => '翻訳', |
3702 | 3721 | 'centralnotice-english' => '英語', |
3703 | | - 'centralnotice-banner-name' => 'テンプレート名', |
| 3722 | + 'centralnotice-banner-name' => 'テンプレート名:', |
3704 | 3723 | 'centralnotice-banner' => 'テンプレート', |
3705 | 3724 | 'centralnotice-banner-heading' => 'テンプレート:$1', |
3706 | 3725 | 'centralnotice-templates' => 'テンプレート', |
— | — | @@ -3744,6 +3763,7 @@ |
3745 | 3764 | 'centralnotice-no-notices-exist' => '通知はひとつもありません。以下に追加してください。', |
3746 | 3765 | 'centralnotice-no-templates-translate' => '翻訳すべきテンプレートはありません。', |
3747 | 3766 | 'centralnotice-number-uses' => '使用目的', |
| 3767 | + 'centralnotice-settings' => '設定', |
3748 | 3768 | 'centralnotice-edit-template' => 'テンプレートを編集する', |
3749 | 3769 | 'centralnotice-edit-template-summary' => 'ローカライズ可能なメッセージを作成するには、ハイフンで結合した文字列を3つの波括弧で囲います。例: {{{jimbo-quote}}}。', |
3750 | 3770 | 'centralnotice-message' => 'メッセージ', |
— | — | @@ -4038,7 +4058,7 @@ |
4039 | 4059 | 'centralnotice-available-templates' => '사용 가능한 템플릿 목록', |
4040 | 4060 | 'centralnotice-template-already-exists' => '템플릿이 이미 설정되어 있습니다. 추가할 수 없습니다.', |
4041 | 4061 | 'centralnotice-preview-template' => '틀 미리 보기', |
4042 | | - 'centralnotice-start-hour' => '시작 시간 (GMT)', |
| 4062 | + 'centralnotice-start-hour' => '시작 시간 (UTC)', |
4043 | 4063 | 'centralnotice-change-lang' => '번역할 언어 변경', |
4044 | 4064 | 'centralnotice-weights' => '중요도', |
4045 | 4065 | 'centralnotice-notice-is-locked' => '공지가 잠겼습니다. |
— | — | @@ -4200,7 +4220,7 @@ |
4201 | 4221 | 'centralnotice-translate-to' => 'Iwwersetzen op', |
4202 | 4222 | 'centralnotice-translate' => 'Iwwersetzen', |
4203 | 4223 | 'centralnotice-english' => 'Englesch', |
4204 | | - 'centralnotice-banner-name' => 'Numm vum Banner', |
| 4224 | + 'centralnotice-banner-name' => 'Numm vum Banner:', |
4205 | 4225 | 'centralnotice-banner' => 'Banner', |
4206 | 4226 | 'centralnotice-banner-heading' => 'Banner: $1', |
4207 | 4227 | 'centralnotice-templates' => 'Banneren', |
— | — | @@ -4240,7 +4260,7 @@ |
4241 | 4261 | 'centralnotice-template-already-exists' => 'De Banner ass schonn enger Campagne zougedeelt. |
4242 | 4262 | Net derbäisetzen', |
4243 | 4263 | 'centralnotice-preview-template' => 'Schabloun weisen ouni ze späicheren', |
4244 | | - 'centralnotice-start-hour' => 'Ufankszäit (GMT)', |
| 4264 | + 'centralnotice-start-hour' => 'Ufankszäit (UTC)', |
4245 | 4265 | 'centralnotice-change-lang' => 'Sprooch vun der Iwwersetzung änneren', |
4246 | 4266 | 'centralnotice-weights' => 'Gewiicht', |
4247 | 4267 | 'centralnotice-notice-is-locked' => "D'Matdeelung ass gespaart. |
— | — | @@ -4327,7 +4347,7 @@ |
4328 | 4348 | 'centralnotice-translate-to' => 'Euverzètte nao', |
4329 | 4349 | 'centralnotice-translate' => 'Euverzètte', |
4330 | 4350 | 'centralnotice-english' => 'Ingels', |
4331 | | - 'centralnotice-banner-name' => 'Sjabloonnaam', |
| 4351 | + 'centralnotice-banner-name' => 'Vaannaam:', |
4332 | 4352 | 'centralnotice-banner' => 'Vaan', |
4333 | 4353 | 'centralnotice-banner-heading' => 'Vaan: $1', |
4334 | 4354 | 'centralnotice-templates' => 'Sjablone', |
— | — | @@ -4340,8 +4360,7 @@ |
4341 | 4361 | Deze weurt neet biegedoon.', |
4342 | 4362 | 'centralnotice-template-exists' => "'t Sjabloon besjteit al. |
4343 | 4363 | Dit weurt neet biegedoon.", |
4344 | | - 'centralnotice-notice-doesnt-exist' => 'De sitemitdeiling besjteit neet. |
4345 | | -Niks weurt eweggesjaf.', |
| 4364 | + 'centralnotice-notice-doesnt-exist' => 'De campagne besteit neet.', |
4346 | 4365 | 'centralnotice-template-still-bound' => "'t Sjabloon is nog neet gekoppeld aan 'n sitemitdeiling. |
4347 | 4366 | 't Weurt neet eweggesjaf.", |
4348 | 4367 | 'centralnotice-template-body' => 'Sjablooninhoud:', |
— | — | @@ -4351,6 +4370,8 @@ |
4352 | 4371 | 'centralnotice-hours' => 'Oer', |
4353 | 4372 | 'centralnotice-min' => 'Menuut', |
4354 | 4373 | 'centralnotice-project-lang' => 'Projektaal', |
| 4374 | + 'centralnotice-select' => 'Selecteer: $1', |
| 4375 | + 'centralnotice-top-ten-languages' => 'Top-10 tale', |
4355 | 4376 | 'centralnotice-project-name' => 'Projeknaam', |
4356 | 4377 | 'centralnotice-start-date' => 'Sjtartdatum', |
4357 | 4378 | 'centralnotice-start-time' => 'Sjtarttied (UTC)', |
— | — | @@ -4363,7 +4384,7 @@ |
4364 | 4385 | 'centralnotice-template-already-exists' => "'t Sjabloon is al gekoppeld aan 'n campagne. |
4365 | 4386 | 't Weurt neet biegedoon.", |
4366 | 4387 | 'centralnotice-preview-template' => 'Veursjouw sjabloon', |
4367 | | - 'centralnotice-start-hour' => 'Sjtarttied (GMT)', |
| 4388 | + 'centralnotice-start-hour' => 'Sjtarttied (UTC)', |
4368 | 4389 | 'centralnotice-change-lang' => 'Euver te zètte taal verangere', |
4369 | 4390 | 'centralnotice-weights' => 'Gewichte', |
4370 | 4391 | 'centralnotice-notice-is-locked' => 'De sitenotice is toe. |
— | — | @@ -4380,6 +4401,7 @@ |
4381 | 4402 | De kins hiejónger ein biedoon.", |
4382 | 4403 | 'centralnotice-no-templates-translate' => "D'r zeen gein sjablone woeveur euverzèttinge gemaak kinne waere", |
4383 | 4404 | 'centralnotice-number-uses' => 'Gebroeke', |
| 4405 | + 'centralnotice-settings' => 'Insjtellinge', |
4384 | 4406 | 'centralnotice-edit-template' => 'Sjabloon bewirke', |
4385 | 4407 | 'centralnotice-message' => 'Berich', |
4386 | 4408 | 'centralnotice-message-not-set' => "'t Berich is neet ingesjtèld", |
— | — | @@ -4530,7 +4552,7 @@ |
4531 | 4553 | 'centralnotice-translate-to' => 'Преведи на', |
4532 | 4554 | 'centralnotice-translate' => 'Преведи', |
4533 | 4555 | 'centralnotice-english' => 'англиски', |
4534 | | - 'centralnotice-banner-name' => 'Назив на шаблонот', |
| 4556 | + 'centralnotice-banner-name' => 'Назив на плакатот:', |
4535 | 4557 | 'centralnotice-banner' => 'Плакат', |
4536 | 4558 | 'centralnotice-banner-heading' => 'Плакат: $1', |
4537 | 4559 | 'centralnotice-templates' => 'Шаблони', |
— | — | @@ -4570,7 +4592,7 @@ |
4571 | 4593 | 'centralnotice-template-already-exists' => 'Шаблонот е веќе врзан за кампањата. |
4572 | 4594 | Нема да биде додаден', |
4573 | 4595 | 'centralnotice-preview-template' => 'Преглед на шаблонот', |
4574 | | - 'centralnotice-start-hour' => 'Започнува (GMT):', |
| 4596 | + 'centralnotice-start-hour' => 'Започнува (UTC):', |
4575 | 4597 | 'centralnotice-change-lang' => 'Смени јазик на превод', |
4576 | 4598 | 'centralnotice-weights' => 'Тегови', |
4577 | 4599 | 'centralnotice-notice-is-locked' => 'Известувањето е заклучено. |
— | — | @@ -4632,6 +4654,7 @@ |
4633 | 4655 | 'centralnotice-end-date' => 'അവസാനിക്കുന്ന തീയ്യതി', |
4634 | 4656 | 'centralnotice-enabled' => 'സജ്ജമാക്കിയിരിക്കുന്നു', |
4635 | 4657 | 'centralnotice-modify' => 'സമർപ്പിക്കുക', |
| 4658 | + 'centralnotice-save-banner' => 'എഴുത്തുപട്ട സേവ് ചെയ്യുക', |
4636 | 4659 | 'centralnotice-preview' => 'എങ്ങനെയുണ്ടെന്നു കാണുക', |
4637 | 4660 | 'centralnotice-add-new' => 'പുതിയൊരു കേന്ദ്രീകൃത അറിയിപ്പ് ചേർക്കുക', |
4638 | 4661 | 'centralnotice-remove' => 'നീക്കംചെയ്യുക', |
— | — | @@ -4649,15 +4672,18 @@ |
4650 | 4673 | 'centralnotice-translate-to' => 'ഇതിലേയ്ക്ക് തർജ്ജമ ചെയ്യുക', |
4651 | 4674 | 'centralnotice-translate' => 'തർജ്ജമ ചെയ്യുക', |
4652 | 4675 | 'centralnotice-english' => 'ഇംഗ്ലീഷ്', |
4653 | | - 'centralnotice-banner-name' => 'ഫലകത്തിന്റെ പേര്', |
| 4676 | + 'centralnotice-banner-name' => 'എഴുത്തുപട്ടയുടെ പേര്:', |
4654 | 4677 | 'centralnotice-banner' => 'ബാനർ', |
| 4678 | + 'centralnotice-banner-heading' => 'എഴുത്തുപട്ട: $1', |
4655 | 4679 | 'centralnotice-templates' => 'ഫലകങ്ങൾ', |
4656 | 4680 | 'centralnotice-weight' => 'ഘനം', |
4657 | 4681 | 'centralnotice-locked' => 'പൂട്ടിയിരിക്കുന്നു', |
4658 | 4682 | 'centralnotice-notice' => 'പ്രചാരണപ്രവർത്തനം', |
| 4683 | + 'centralnotice-notice-heading' => 'പ്രചരണം: $1', |
4659 | 4684 | 'centralnotice-notices' => 'അറിയിപ്പുകൾ', |
4660 | 4685 | 'centralnotice-notice-exists' => 'അറിയിപ്പ് ഇപ്പോൾ തന്നെ ഉണ്ട്. |
4661 | 4686 | കൂട്ടിച്ചേർക്കുന്നില്ല', |
| 4687 | + 'centralnotice-no-language' => 'പ്രചരണത്തിനായി ഭാഷയൊന്നും തിരഞ്ഞെടുക്കപ്പെട്ടിട്ടില്ല. കൂട്ടിച്ചേർക്കുന്നില്ല.', |
4662 | 4688 | 'centralnotice-template-exists' => 'ഫലകം നിലവിലുണ്ട്. |
4663 | 4689 | കൂട്ടിച്ചേർക്കുന്നില്ല', |
4664 | 4690 | 'centralnotice-notice-doesnt-exist' => 'പ്രചാരണപ്രവർത്തനം നിലനിൽക്കുന്നില്ല', |
— | — | @@ -4703,6 +4729,7 @@ |
4704 | 4730 | താഴെ ഒരെണ്ണം കൂട്ടിച്ചേർക്കുക', |
4705 | 4731 | 'centralnotice-no-templates-translate' => 'ഇതിന്റെ തർജ്ജമകൾ തിരുത്താനായി ഒരു ഫലകവും ഇപ്പോഴില്ല', |
4706 | 4732 | 'centralnotice-number-uses' => 'ഉപയോഗങ്ങൾ', |
| 4733 | + 'centralnotice-settings' => 'സജ്ജീകരണങ്ങൾ', |
4707 | 4734 | 'centralnotice-edit-template' => 'ഫലകം തിരുത്തുക', |
4708 | 4735 | 'centralnotice-edit-template-summary' => 'പ്രാദേശീകരിക്കാവുന്ന സന്ദേശം സൃഷ്ടിക്കാൻ, മൂന്ന് വളയൻ കോഷ്ഠകങ്ങൾക്കുള്ളിൽ ഹൈഫൻ ഉപയോഗിച്ച് ചേർത്ത പദങ്ങൾ നൽകുക, ഉദാ: {{{jimbo-quote}}}.', |
4709 | 4736 | 'centralnotice-message' => 'സന്ദേശം', |
— | — | @@ -4717,9 +4744,12 @@ |
4718 | 4745 | 'centralnotice-expand-button' => '{{int:centralnotice-shared-expand}} ബട്ടൺ', |
4719 | 4746 | 'centralnotice-translate-button' => 'പരിഭാഷാസഹായി ബട്ടൺ', |
4720 | 4747 | 'centralnotice-donate-button' => 'സംഭാവനാ ബട്ടൺ', |
| 4748 | + 'centralnotice-expanded-banner' => 'വികസിപ്പിച്ച എഴുത്തുപട്ട', |
| 4749 | + 'centralnotice-collapsed-banner' => 'ചുരുക്കിയ എഴുത്തുപട്ട', |
4721 | 4750 | 'centralnotice-banner-display' => 'പ്രദർശിപ്പിക്കേണ്ടത്:', |
4722 | 4751 | 'centralnotice-banner-anonymous' => 'അജ്ഞാത ഉപയോക്താക്കൾ', |
4723 | 4752 | 'centralnotice-banner-logged-in' => 'പ്രവേശിച്ചിട്ടുള്ള ഉപയോക്താക്കൾ', |
| 4753 | + 'centralnotice-banner-type' => 'എഴുത്തുപട്ടയുടെ തരം:', |
4724 | 4754 | 'centralnotice-banner-hidable' => 'സ്ഥിരസ്ഥിതി/മറയ്ക്കാവുന്നത്', |
4725 | 4755 | 'centralnotice-banner-collapsible' => 'ചുരുക്കാവുന്നത്', |
4726 | 4756 | 'right-centralnotice-admin' => 'കേന്ദ്രീകൃത അറിയിപ്പുകൾ കൈകാര്യം ചെയ്യുക', |
— | — | @@ -5018,7 +5048,7 @@ |
5019 | 5049 | 'centralnotice-translate-to' => 'Vertalen naar', |
5020 | 5050 | 'centralnotice-translate' => 'Vertalen', |
5021 | 5051 | 'centralnotice-english' => 'Engels', |
5022 | | - 'centralnotice-banner-name' => 'Sjabloonnaam', |
| 5052 | + 'centralnotice-banner-name' => 'Bannernaam:', |
5023 | 5053 | 'centralnotice-banner' => 'Banner', |
5024 | 5054 | 'centralnotice-banner-heading' => 'Banner: $1', |
5025 | 5055 | 'centralnotice-templates' => 'Sjablonen', |
— | — | @@ -5058,7 +5088,7 @@ |
5059 | 5089 | 'centralnotice-template-already-exists' => 'Het sjabloon is al gekoppeld aan een campagne. |
5060 | 5090 | Het wordt niet toegevoegd.', |
5061 | 5091 | 'centralnotice-preview-template' => 'Voorvertoning sjabloon', |
5062 | | - 'centralnotice-start-hour' => 'Starttijd (in GMT)', |
| 5092 | + 'centralnotice-start-hour' => 'Starttijd (in UTC)', |
5063 | 5093 | 'centralnotice-change-lang' => 'Te vertalen taal wijzigen', |
5064 | 5094 | 'centralnotice-weights' => 'Gewichten', |
5065 | 5095 | 'centralnotice-notice-is-locked' => 'De sitenotice is afgesloten. |
— | — | @@ -5261,7 +5291,7 @@ |
5262 | 5292 | 'centralnotice-template-already-exists' => 'Mal er allerede knyttet til kampanje. |
5263 | 5293 | Ikke lagt inn', |
5264 | 5294 | 'centralnotice-preview-template' => 'Forhåndsvis mal', |
5265 | | - 'centralnotice-start-hour' => 'Starttid (GMT)', |
| 5295 | + 'centralnotice-start-hour' => 'Starttid (UTC)', |
5266 | 5296 | 'centralnotice-change-lang' => 'Endre oversettelsesspråk', |
5267 | 5297 | 'centralnotice-weights' => 'Tyngder', |
5268 | 5298 | 'centralnotice-notice-is-locked' => 'Melding er låst. |
— | — | @@ -5460,7 +5490,7 @@ |
5461 | 5491 | 'centralnotice-translate-to' => 'Przetłumacz na', |
5462 | 5492 | 'centralnotice-translate' => 'Przetłumacz', |
5463 | 5493 | 'centralnotice-english' => 'Angielski', |
5464 | | - 'centralnotice-banner-name' => 'Nazwa szablonu', |
| 5494 | + 'centralnotice-banner-name' => 'Nazwa banera', |
5465 | 5495 | 'centralnotice-banner' => 'Baner', |
5466 | 5496 | 'centralnotice-banner-heading' => 'Baner – $1', |
5467 | 5497 | 'centralnotice-templates' => 'Banery', |
— | — | @@ -5573,7 +5603,7 @@ |
5574 | 5604 | 'centralnotice-translate-to' => 'Volté an', |
5575 | 5605 | 'centralnotice-translate' => 'Volté', |
5576 | 5606 | 'centralnotice-english' => 'Anglèis', |
5577 | | - 'centralnotice-banner-name' => 'Nòm ëd lë stamp', |
| 5607 | + 'centralnotice-banner-name' => 'Nòm dël tilèt:', |
5578 | 5608 | 'centralnotice-banner' => 'Tilèt', |
5579 | 5609 | 'centralnotice-banner-heading' => 'Tilèt: $1', |
5580 | 5610 | 'centralnotice-templates' => 'Stamp', |
— | — | @@ -5613,7 +5643,7 @@ |
5614 | 5644 | 'centralnotice-template-already-exists' => "Lë stamp a l'é già gropà a na campagna. |
5615 | 5645 | Pa giontà", |
5616 | 5646 | 'centralnotice-preview-template' => 'Previsualisassion stamp', |
5617 | | - 'centralnotice-start-hour' => "Ora d'inissi (GMT)", |
| 5647 | + 'centralnotice-start-hour' => "Ora d'inissi (UTC)", |
5618 | 5648 | 'centralnotice-change-lang' => 'Cangé lenga ëd tradussion', |
5619 | 5649 | 'centralnotice-weights' => 'Pèis', |
5620 | 5650 | 'centralnotice-notice-is-locked' => 'Neuva blocà. |
— | — | @@ -5734,7 +5764,7 @@ |
5735 | 5765 | 'centralnotice-translate-to' => 'Traduzir para', |
5736 | 5766 | 'centralnotice-translate' => 'Traduzir', |
5737 | 5767 | 'centralnotice-english' => 'Inglês', |
5738 | | - 'centralnotice-banner-name' => 'Nome do modelo', |
| 5768 | + 'centralnotice-banner-name' => 'Nome do modelo:', |
5739 | 5769 | 'centralnotice-banner' => 'Modelo', |
5740 | 5770 | 'centralnotice-banner-heading' => 'Modelo: $1', |
5741 | 5771 | 'centralnotice-templates' => 'Modelos', |
— | — | @@ -5774,7 +5804,7 @@ |
5775 | 5805 | 'centralnotice-template-already-exists' => 'O modelo já está ligado a um aviso. |
5776 | 5806 | Não adicionado.', |
5777 | 5807 | 'centralnotice-preview-template' => 'Antever modelo', |
5778 | | - 'centralnotice-start-hour' => 'Hora de início (GMT)', |
| 5808 | + 'centralnotice-start-hour' => 'Hora de início (UTC)', |
5779 | 5809 | 'centralnotice-change-lang' => 'Alterar língua de tradução', |
5780 | 5810 | 'centralnotice-weights' => 'Pesos', |
5781 | 5811 | 'centralnotice-notice-is-locked' => 'O aviso está bloqueado. |
— | — | @@ -5855,7 +5885,7 @@ |
5856 | 5886 | 'centralnotice-translate-to' => 'Traduzir para', |
5857 | 5887 | 'centralnotice-translate' => 'Traduzir', |
5858 | 5888 | 'centralnotice-english' => 'Inglês', |
5859 | | - 'centralnotice-banner-name' => 'Nome do modelo', |
| 5889 | + 'centralnotice-banner-name' => 'Nome do banner:', |
5860 | 5890 | 'centralnotice-banner' => 'Banner', |
5861 | 5891 | 'centralnotice-banner-heading' => 'Banner: $1', |
5862 | 5892 | 'centralnotice-templates' => 'Modelos', |
— | — | @@ -5895,7 +5925,7 @@ |
5896 | 5926 | 'centralnotice-template-already-exists' => 'O modelo já está ligado a campanha. |
5897 | 5927 | Não adicionado', |
5898 | 5928 | 'centralnotice-preview-template' => 'Prever modelo', |
5899 | | - 'centralnotice-start-hour' => 'Hora de início (GMT)', |
| 5929 | + 'centralnotice-start-hour' => 'Hora de início (UTC)', |
5900 | 5930 | 'centralnotice-change-lang' => 'Alterar língua de tradução', |
5901 | 5931 | 'centralnotice-weights' => 'Pesos', |
5902 | 5932 | 'centralnotice-notice-is-locked' => 'O aviso está bloqueado. |
— | — | @@ -5912,6 +5942,7 @@ |
5913 | 5943 | Adicione um abaixo', |
5914 | 5944 | 'centralnotice-no-templates-translate' => 'Não há quaisquer modelos para os quais seja possível editar traduções', |
5915 | 5945 | 'centralnotice-number-uses' => 'Utilizações', |
| 5946 | + 'centralnotice-settings' => 'Configurações', |
5916 | 5947 | 'centralnotice-edit-template' => 'Editar modelo', |
5917 | 5948 | 'centralnotice-edit-template-summary' => 'Para criar uma mensagem localizável, coloque entre três chaves um texto que contenha um hífen; por exemplo, {{{texto-citado}}}.', |
5918 | 5949 | 'centralnotice-message' => 'Mensagem', |
— | — | @@ -6158,7 +6189,7 @@ |
6159 | 6190 | 'centralnotice-translate-to' => 'Перевод на', |
6160 | 6191 | 'centralnotice-translate' => 'Перевод', |
6161 | 6192 | 'centralnotice-english' => 'английский', |
6162 | | - 'centralnotice-banner-name' => 'Название баннера', |
| 6193 | + 'centralnotice-banner-name' => 'Название баннера:', |
6163 | 6194 | 'centralnotice-banner' => 'Баннер', |
6164 | 6195 | 'centralnotice-banner-heading' => 'Баннер: $1', |
6165 | 6196 | 'centralnotice-templates' => 'Шаблоны', |
— | — | @@ -6198,7 +6229,7 @@ |
6199 | 6230 | 'centralnotice-template-already-exists' => 'Шаблон уже привязан. |
6200 | 6231 | Не добавлен', |
6201 | 6232 | 'centralnotice-preview-template' => 'Предпросмотр шаблона', |
6202 | | - 'centralnotice-start-hour' => 'Время начала (GMT)', |
| 6233 | + 'centralnotice-start-hour' => 'Время начала (UTC)', |
6203 | 6234 | 'centralnotice-change-lang' => 'Изменить язык перевода', |
6204 | 6235 | 'centralnotice-weights' => 'Веса', |
6205 | 6236 | 'centralnotice-notice-is-locked' => 'Уведомление заблокировано. |
— | — | @@ -6302,7 +6333,7 @@ |
6303 | 6334 | 'centralnotice-translate-to' => 'Манна тылбаас', |
6304 | 6335 | 'centralnotice-translate' => 'Тылбаас', |
6305 | 6336 | 'centralnotice-english' => 'Аҥылычаан', |
6306 | | - 'centralnotice-banner-name' => 'Халыып аата', |
| 6337 | + 'centralnotice-banner-name' => 'Бааннер аата:', |
6307 | 6338 | 'centralnotice-templates' => 'Халыыптар', |
6308 | 6339 | 'centralnotice-weight' => 'Кэтитэ', |
6309 | 6340 | 'centralnotice-locked' => 'Хааччахтаммыт/бобуллубут', |
— | — | @@ -7553,7 +7584,7 @@ |
7554 | 7585 | 'centralnotice-available-templates' => 'Үрнәкләр', |
7555 | 7586 | 'centralnotice-template-already-exists' => 'Үрнәк өстәлмәде', |
7556 | 7587 | 'centralnotice-preview-template' => 'Алдан карау', |
7557 | | - 'centralnotice-start-hour' => 'Башлау сәгате (GMT)', |
| 7588 | + 'centralnotice-start-hour' => 'Башлау сәгате (UTC)', |
7558 | 7589 | 'centralnotice-change-lang' => 'Тәрҗемә телен үзгәртү', |
7559 | 7590 | 'centralnotice-weights' => 'Үлчәү', |
7560 | 7591 | 'centralnotice-notice-is-locked' => 'Хәбәр чикләнде', |
— | — | @@ -7624,7 +7655,7 @@ |
7625 | 7656 | 'centralnotice-translate-to' => 'Переклад на', |
7626 | 7657 | 'centralnotice-translate' => 'Переклад', |
7627 | 7658 | 'centralnotice-english' => 'англійську', |
7628 | | - 'centralnotice-banner-name' => 'Назва шаблону', |
| 7659 | + 'centralnotice-banner-name' => 'Назва банера:', |
7629 | 7660 | 'centralnotice-banner' => 'Банер', |
7630 | 7661 | 'centralnotice-banner-heading' => 'Банер: $1', |
7631 | 7662 | 'centralnotice-templates' => 'Шаблони', |
— | — | @@ -7660,7 +7691,7 @@ |
7661 | 7692 | 'centralnotice-template-already-exists' => "Шаблон вже прив'язаний. |
7662 | 7693 | Не доданий", |
7663 | 7694 | 'centralnotice-preview-template' => 'Попередній перегляд шаблону', |
7664 | | - 'centralnotice-start-hour' => 'Час початку (GMT)', |
| 7695 | + 'centralnotice-start-hour' => 'Час початку (UTC)', |
7665 | 7696 | 'centralnotice-change-lang' => 'Змінити мову перекладу', |
7666 | 7697 | 'centralnotice-weights' => 'Ваги', |
7667 | 7698 | 'centralnotice-notice-is-locked' => 'Повідомлення заблоковано. |
— | — | @@ -7817,7 +7848,7 @@ |
7818 | 7849 | 'centralnotice-translate-to' => 'Dịch ra', |
7819 | 7850 | 'centralnotice-translate' => 'Biên dịch', |
7820 | 7851 | 'centralnotice-english' => 'tiếng Anh', |
7821 | | - 'centralnotice-banner-name' => 'Tên bảng', |
| 7852 | + 'centralnotice-banner-name' => 'Tên bảng:', |
7822 | 7853 | 'centralnotice-banner' => 'Bảng', |
7823 | 7854 | 'centralnotice-banner-heading' => 'Bảng: $1', |
7824 | 7855 | 'centralnotice-templates' => 'Bảng', |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | } |
8 | 8 | |
9 | 9 | class SpecialNoticeTemplate extends UnlistedSpecialPage { |
10 | | - var $editable; |
| 10 | + var $editable, $centralNoticeError; |
11 | 11 | |
12 | 12 | function __construct() { |
13 | 13 | parent::__construct( 'NoticeTemplate' ); |
— | — | @@ -32,6 +32,9 @@ |
33 | 33 | |
34 | 34 | // Check permissions |
35 | 35 | $this->editable = $wgUser->isAllowed( 'centralnotice-admin' ); |
| 36 | + |
| 37 | + // Initialize error variable |
| 38 | + $this->centralNoticeError = false; |
36 | 39 | |
37 | 40 | // Show summary |
38 | 41 | $wgOut->addWikiMsg( 'centralnotice-summary' ); |
— | — | @@ -73,10 +76,9 @@ |
74 | 77 | } |
75 | 78 | |
76 | 79 | // Handle adding banner |
77 | | - // FIXME: getText()? weak comparison |
78 | 80 | if ( $method == 'addTemplate' ) { |
79 | | - $newTemplateName = $wgRequest->getVal( 'templateName' ); |
80 | | - $newTemplateBody = $wgRequest->getVal( 'templateBody' ); |
| 81 | + $newTemplateName = $wgRequest->getText( 'templateName' ); |
| 82 | + $newTemplateBody = $wgRequest->getText( 'templateBody' ); |
81 | 83 | if ( $newTemplateName != '' && $newTemplateBody != '' ) { |
82 | 84 | $this->addTemplate( |
83 | 85 | $newTemplateName, |
— | — | @@ -86,15 +88,15 @@ |
87 | 89 | ); |
88 | 90 | $sub = 'view'; |
89 | 91 | } else { |
90 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-null-string' ); |
| 92 | + $this->showError( 'centralnotice-null-string' ); |
91 | 93 | } |
92 | 94 | } |
93 | 95 | |
94 | 96 | // Handle editing banner |
95 | 97 | if ( $method == 'editTemplate' ) { |
96 | 98 | $this->editTemplate( |
97 | | - $wgRequest->getVal( 'template' ), |
98 | | - $wgRequest->getVal( 'templateBody' ), |
| 99 | + $wgRequest->getText( 'template' ), |
| 100 | + $wgRequest->getText( 'templateBody' ), |
99 | 101 | $wgRequest->getBool( 'displayAnon' ), |
100 | 102 | $wgRequest->getBool( 'displayAccount' ) |
101 | 103 | ); |
— | — | @@ -102,7 +104,7 @@ |
103 | 105 | } |
104 | 106 | |
105 | 107 | } else { |
106 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'sessionfailure' ); |
| 108 | + $this->showError( 'sessionfailure' ); |
107 | 109 | } |
108 | 110 | |
109 | 111 | } |
— | — | @@ -144,7 +146,7 @@ |
145 | 147 | return; |
146 | 148 | |
147 | 149 | } else { |
148 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'sessionfailure' ); |
| 150 | + $this->showError( 'sessionfailure' ); |
149 | 151 | } |
150 | 152 | |
151 | 153 | } |
— | — | @@ -328,15 +330,12 @@ |
329 | 331 | $bodyPage = Title::newFromText( "Centralnotice-template-{$currentTemplate}", NS_MEDIAWIKI ); |
330 | 332 | $curRev = Revision::newFromTitle( $bodyPage ); |
331 | 333 | $body = $curRev ? $curRev->getText() : ''; |
332 | | - |
| 334 | + |
333 | 335 | // Extract message fields from the banner body |
334 | 336 | $fields = array(); |
335 | 337 | $allowedChars = Title::legalChars(); |
336 | 338 | preg_match_all( "/\{\{\{([$allowedChars]+)\}\}\}/u", $body, $fields ); |
337 | | - |
338 | | - // Restore banner body state in the event of an error on form submit |
339 | | - $body = $wgRequest->getVal( 'templateBody', $body ); |
340 | | - |
| 339 | + |
341 | 340 | // If there are any message fields in the banner, display translation tools. |
342 | 341 | if ( count( $fields[0] ) > 0 ) { |
343 | 342 | if ( $this->editable ) { |
— | — | @@ -353,20 +352,20 @@ |
354 | 353 | 'width' => '100%' |
355 | 354 | ) |
356 | 355 | ); |
357 | | - |
| 356 | + |
358 | 357 | // Table headers |
359 | 358 | $htmlOut .= Xml::element( 'th', array( 'width' => '15%' ), wfMsg( 'centralnotice-message' ) ); |
360 | 359 | $htmlOut .= Xml::element( 'th', array( 'width' => '5%' ), wfMsg ( 'centralnotice-number-uses' ) ); |
361 | 360 | $htmlOut .= Xml::element( 'th', array( 'width' => '40%' ), wfMsg ( 'centralnotice-english' ) ); |
362 | 361 | $languages = Language::getLanguageNames(); |
363 | 362 | $htmlOut .= Xml::element( 'th', array( 'width' => '40%' ), $languages[$wpUserLang] ); |
364 | | - |
| 363 | + |
365 | 364 | // Remove duplicate message fields |
366 | 365 | $filteredFields = array(); |
367 | 366 | foreach ( $fields[1] as $field ) { |
368 | 367 | $filteredFields[$field] = array_key_exists( $field, $filteredFields ) ? $filteredFields[$field] + 1 : 1; |
369 | 368 | } |
370 | | - |
| 369 | + |
371 | 370 | // Table rows |
372 | 371 | foreach ( $filteredFields as $field => $count ) { |
373 | 372 | // Message |
— | — | @@ -463,22 +462,22 @@ |
464 | 463 | $htmlOut .= Xml::hidden( 'wpMethod', 'editTemplate' ); |
465 | 464 | } |
466 | 465 | |
| 466 | + // If there was an error, we'll need to restore the state of the form |
| 467 | + if ( $wgRequest->wasPosted() && $wgRequest->getVal( 'mainform' ) ) { |
| 468 | + $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
| 469 | + $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
| 470 | + $body = $wgRequest->getVal( 'templateBody', $body ); |
| 471 | + } else { // Defaults |
| 472 | + $displayAnon = ( $row->tmp_display_anon == 1 ); |
| 473 | + $displayAccount = ( $row->tmp_display_account == 1 ); |
| 474 | + } |
| 475 | + |
467 | 476 | // Show banner settings |
468 | 477 | $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-settings' ) ); |
469 | 478 | $htmlOut .= Xml::openElement( 'p', null ); |
470 | 479 | $htmlOut .= wfMsg( 'centralnotice-banner-display' ); |
471 | | - if ( $wgRequest->wasPosted() ) { |
472 | | - $displayAnon = $wgRequest->getCheck( 'displayAnon' ); // Restore checkbox state in event of error |
473 | | - } else { |
474 | | - $displayAnon = ( $row->tmp_display_anon == 1 ); // Default to saved state |
475 | | - } |
476 | 480 | $htmlOut .= Xml::check( 'displayAnon', $displayAnon, wfArrayMerge( $disabled, array( 'id' => 'displayAnon' ) ) ); |
477 | 481 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-anonymous' ), 'displayAnon' ); |
478 | | - if ( $wgRequest->wasPosted() ) { |
479 | | - $displayAccount = $wgRequest->getCheck( 'displayAccount' ); // Restore checkbox state in event of error |
480 | | - } else { |
481 | | - $displayAccount = ( $row->tmp_display_account == 1 ); // Default to saved state |
482 | | - } |
483 | 482 | $htmlOut .= Xml::check( 'displayAccount', $displayAccount, wfArrayMerge( $disabled, array( 'id' => 'displayAccount' ) ) ); |
484 | 483 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-logged-in' ), 'displayAccount' ); |
485 | 484 | $htmlOut .= Xml::closeElement( 'p' ); |
— | — | @@ -499,6 +498,7 @@ |
500 | 499 | $htmlOut .= Xml::textarea( 'templateBody', $body, 60, 20, $readonly ); |
501 | 500 | $htmlOut .= Xml::closeElement( 'fieldset' ); |
502 | 501 | if ( $this->editable ) { |
| 502 | + $htmlOut .= Xml::hidden( 'mainform', 'true' ); // Indicate which form was submitted |
503 | 503 | $htmlOut .= Xml::hidden( 'authtoken', $wgUser->editToken() ); |
504 | 504 | $htmlOut .= Xml::tags( 'div', |
505 | 505 | array( 'class' => 'cn-buttons' ), |
— | — | @@ -614,7 +614,7 @@ |
615 | 615 | $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ ); |
616 | 616 | |
617 | 617 | if ( $dbr->numRows( $res ) > 0 ) { |
618 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-template-still-bound' ); |
| 618 | + $this->showError( 'centralnotice-template-still-bound' ); |
619 | 619 | return; |
620 | 620 | } else { |
621 | 621 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -639,7 +639,7 @@ |
640 | 640 | global $wgOut; |
641 | 641 | |
642 | 642 | if ( $body == '' || $name == '' ) { |
643 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-null-string' ); |
| 643 | + $this->showError( 'centralnotice-null-string' ); |
644 | 644 | return; |
645 | 645 | } |
646 | 646 | |
— | — | @@ -655,7 +655,7 @@ |
656 | 656 | ); |
657 | 657 | |
658 | 658 | if ( $dbr->numRows( $res ) > 0 ) { |
659 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-template-exists' ); |
| 659 | + $this->showError( 'centralnotice-template-exists' ); |
660 | 660 | return false; |
661 | 661 | } else { |
662 | 662 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -684,7 +684,7 @@ |
685 | 685 | global $wgOut; |
686 | 686 | |
687 | 687 | if ( $body == '' || $name == '' ) { |
688 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-null-string' ); |
| 688 | + $this->showError( 'centralnotice-null-string' ); |
689 | 689 | return; |
690 | 690 | } |
691 | 691 | |
— | — | @@ -807,4 +807,10 @@ |
808 | 808 | } |
809 | 809 | return $translations; |
810 | 810 | } |
| 811 | + |
| 812 | + function showError( $message ) { |
| 813 | + global $wgOut; |
| 814 | + $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", $message ); |
| 815 | + $this->centralNoticeError = true; |
| 816 | + } |
811 | 817 | } |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | /* Functions */ |
12 | 12 | |
13 | | - function CentralNoticeDB() { |
| 13 | + function __construct() { |
14 | 14 | // Internationalization |
15 | 15 | wfLoadExtensionMessages( 'CentralNotice' ); |
16 | 16 | } |
— | — | @@ -118,20 +118,5 @@ |
119 | 119 | } |
120 | 120 | return $templates; |
121 | 121 | } |
122 | | - |
123 | | - public function updatePreferred( $notice, $preferred ) { |
124 | | - $dbw = wfGetDB( DB_MASTER ); |
125 | | - $dbw->begin(); |
126 | | - |
127 | | - $res = $dbw->update( 'cn_notices', |
128 | | - array( |
129 | | - 'not_preferred' => $preferred, |
130 | | - ), |
131 | | - array( |
132 | | - 'not_name' => $notice |
133 | | - ) |
134 | | - ); |
135 | | - $dbw->commit(); |
136 | | - return $res; |
137 | | - } |
| 122 | + |
138 | 123 | } |
Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice |
___________________________________________________________________ |
Modified: svn:mergeinfo |
139 | 124 | Merged /trunk/extensions/CentralNotice:r71774-71997 |