Index: trunk/extensions/CentralNotice/patch-add-preferred.sql |
— | — | @@ -1,6 +0,0 @@ |
2 | | -# Support for one notice to supercede all others. This allows one notice to |
3 | | -# cancel out all the templates that a non preffered notice might have if they |
4 | | -# overlap. Use case is to be able to use one all language and projects notice |
5 | | -# and have it superceded by a specific one for en wikipedia. |
6 | | - |
7 | | -ALTER TABLE cn_notices ADD COLUMN not_preferred bool NOT NULL default '0'; |
Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -119,6 +119,7 @@ |
120 | 120 | $dir = dirname( __FILE__ ) . '/'; |
121 | 121 | |
122 | 122 | if ( $wgCentralNoticeLoader ) { |
| 123 | + $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCentralNoticeSchema'; |
123 | 124 | $wgHooks['BeforePageDisplay'][] = 'efCentralNoticeLoader'; |
124 | 125 | $wgHooks['MakeGlobalVariablesScript'][] = 'efCentralNoticeDefaults'; |
125 | 126 | |
— | — | @@ -147,6 +148,17 @@ |
148 | 149 | } |
149 | 150 | } |
150 | 151 | |
| 152 | +function efCentralNoticeSchema() { |
| 153 | + global $wgDBtype, $wgExtNewTables; |
| 154 | + |
| 155 | + $base = dirname( __FILE__ ); |
| 156 | + if ( $wgDBtype == 'mysql' ) { |
| 157 | + $wgExtNewTables[] = array( 'cn_notices', $base . '/CentralNotice.sql' ); |
| 158 | + $wgExtNewTables[] = array( 'cn_notice_languages', $base . '/patches/patch-notice_languages.sql' ); |
| 159 | + } |
| 160 | + return true; |
| 161 | +} |
| 162 | + |
151 | 163 | function efCentralNoticeLoader( $out, $skin ) { |
152 | 164 | global $wgUser, $wgOut, $wgLang; |
153 | 165 | global $wgNoticeProject, $wgNoticeCentralPath, $wgNoticeLocalPath, $wgNoticeUseLocalNotice; |
Index: trunk/extensions/CentralNotice/patches/patch-add-preferred.sql |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +# Support for one notice to supercede all others. This allows one notice to |
| 3 | +# cancel out all the templates that a non preffered notice might have if they |
| 4 | +# overlap. Use case is to be able to use one all language and projects notice |
| 5 | +# and have it superceded by a specific one for en wikipedia. |
| 6 | + |
| 7 | +ALTER TABLE cn_notices ADD COLUMN not_preferred bool NOT NULL default '0'; |
Property changes on: trunk/extensions/CentralNotice/patches/patch-add-preferred.sql |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 8 | + native |
Index: trunk/extensions/CentralNotice/patches/patch-notice_languages.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +-- Update to allow for any number of languages per notice. |
| 3 | + |
| 4 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notice_languages ( |
| 5 | + `id` int unsigned NOT NULL auto_increment, |
| 6 | + `not_id` int unsigned NOT NULL, |
| 7 | + `not_language` varchar(32) NOT NULL, |
| 8 | + PRIMARY KEY (`id`), |
| 9 | + UNIQUE KEY `not_id_not_language` (`not_id`,`not_language`) |
| 10 | +) /*$wgDBTableOptions*/; |
\ No newline at end of file |
Index: trunk/extensions/CentralNotice/CentralNotice.sql |
— | — | @@ -1,4 +1,4 @@ |
2 | | -CREATE TABLE `cn_notices` ( |
| 2 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notices ( |
3 | 3 | `not_id` int NOT NULL auto_increment, |
4 | 4 | `not_name` varchar(255) NOT NULL, |
5 | 5 | `not_start` char(14) NOT NULL, |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | PRIMARY KEY (`not_id`) |
13 | 13 | ) /*$wgDBTableOptions*/; |
14 | 14 | |
15 | | -CREATE TABLE `cn_assignments` ( |
| 15 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_assignments ( |
16 | 16 | `asn_id` int NOT NULL auto_increment, |
17 | 17 | `not_id` int NOT NULL, |
18 | 18 | `tmp_id` int NOT NULL, |
— | — | @@ -19,13 +19,13 @@ |
20 | 20 | PRIMARY KEY (`asn_id`) |
21 | 21 | ) /*$wgDBTableOptions*/; |
22 | 22 | |
23 | | -CREATE TABLE `cn_templates` ( |
| 23 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_templates ( |
24 | 24 | `tmp_id` int NOT NULL auto_increment, |
25 | 25 | `tmp_name` varchar(255) default NULL, |
26 | 26 | PRIMARY KEY (`tmp_id`) |
27 | 27 | ) /*$wgDBTableOptions*/; |
28 | 28 | |
29 | | -CREATE TABLE `cn_notice_languages` ( |
| 29 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notice_languages ( |
30 | 30 | `id` int unsigned NOT NULL auto_increment, |
31 | 31 | `not_id` int unsigned NOT NULL, |
32 | 32 | `not_language` varchar(32) NOT NULL, |
Index: trunk/extensions/CentralNotice/arrow.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/CentralNotice/arrow.png |
___________________________________________________________________ |
Name: svn:mime-type |
33 | 33 | + application/octet-stream |