diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-08-16 18:06:18 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-08-16 18:06:18 +0000 |
commit | 26fa7c730f878220a46478c47f6145f459f68688 (patch) | |
tree | 16c0ce7230150b0f8cee0f4d360c9756f8746764 /database/updates.inc | |
parent | 6ef678e4475c6e500b371be6f5a9a66115686480 (diff) | |
download | brdo-26fa7c730f878220a46478c47f6145f459f68688.tar.gz brdo-26fa7c730f878220a46478c47f6145f459f68688.tar.bz2 |
- Patch #16216 by nedjo: multiple block regions!
Diffstat (limited to 'database/updates.inc')
-rw-r--r-- | database/updates.inc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/database/updates.inc b/database/updates.inc index 435af3373..e57ed1742 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -120,7 +120,8 @@ $sql_updates = array( "2005-05-22" => "update_141", "2005-07-29" => "update_142", "2005-07-30" => "update_143", - "2005-08-08" => "update_144" + "2005-08-08" => "update_144", + "2005-08-15" => "update_145" ); function update_32() { @@ -2550,6 +2551,28 @@ function update_144() { return $ret; } +function update_145() { + $default_theme = variable_get('theme_default', 'bluemarine'); + $ret = array(); + $ret[] = update_sql("ALTER TABLE {blocks} CHANGE region region varchar(64) default 'left' NOT NULL"); + $ret[] = update_sql("ALTER TABLE {blocks} ADD theme varchar(255) NOT NULL default ''"); + + // Intialize block data for default theme + $ret[] = update_sql("UPDATE {blocks} SET region = 'left' WHERE region = '0'"); + $ret[] = update_sql("UPDATE {blocks} SET region = 'right' WHERE region = '1'"); + db_query("UPDATE {blocks} SET theme = '%s'", $default_theme); + + // Initialze block data for other enabled themes. + $themes = list_themes(); + foreach (array_keys($themes) as $theme) { + if (($theme != $default_theme) && $themes[$theme]->status == 1) { + system_initialize_theme_blocks($theme); + } + } + + return $ret; +} + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql); |