summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-11-14 13:23:54 -0700
committerChad Kieffer <ckieffer@gmail.com>2009-11-14 13:23:54 -0700
commit0674f18eb5f05471bf4090a0c83e88eadf349080 (patch)
tree2b783291954ed1c7a9f040da7bb27a35c5297a1a /modules/gallery/helpers
parentd29d339ea0088b2aa9cd11701289db03ec307ea3 (diff)
parent100a66d861849ab0d78dca84b0b06c1af973752a (diff)
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_installer.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 470c54cf..57a5ee9f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -399,18 +399,21 @@ class gallery_installer {
module::set_version("gallery", $version = 16);
}
+ // Convert block keys to an md5 hash of the module and block name
if ($version == 16) {
- $blocks = block_manager::get_active($location);
- $new_blocks = array();
- foreach ($blocks as $block) {
- $new_blocks[md5("{$block[0]}:{$block[1]}")] = $block;
+ foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $location) {
+ $blocks = block_manager::get_active($location);
+ $new_blocks = array();
+ foreach ($blocks as $block) {
+ $new_blocks[md5("{$block[0]}:{$block[1]}")] = $block;
+ }
+ block_manager::set_active($location, $new_blocks);
}
- block_manager::set_active($location, $new_blocks);
module::set_version("gallery", $version = 17);
}
+ // We didn't like md5 hashes so convert block keys back to random keys to allow duplicates.
if ($version == 17) {
- // Once published we can't go back so reset the keys to a random to allow duplicates
foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $location) {
$blocks = block_manager::get_active($location);
$new_blocks = array();
@@ -422,13 +425,11 @@ class gallery_installer {
module::set_version("gallery", $version = 18);
}
+ // Rename blocks_site.sidebar to blocks_site_sidebar
if ($version == 18) {
- // Once published we can't go back so reset the keys to a random to allow duplicates
- foreach (array("dashboard_sidebar", "dashboard_center", "site_sidebar") as $location) {
- $blocks = block_manager::get_active("site.sidebar");
- block_manager::set_active("site_sidebar", $blocks);
- module::clear_var("gallery", "blocks_site.sidebar");
- }
+ $blocks = block_manager::get_active("site.sidebar");
+ block_manager::set_active("site_sidebar", $blocks);
+ module::clear_var("gallery", "blocks_site.sidebar");
module::set_version("gallery", $version = 19);
}
}