summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_installer.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/gallery_installer.php')
-rw-r--r--modules/gallery/helpers/gallery_installer.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index f7b8da5f..01c59eaa 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -92,7 +92,7 @@ class gallery_installer {
`name` varchar(255) default NULL,
`owner_id` int(9) default NULL,
`parent_id` int(9) NOT NULL,
- `rand_key` float default NULL,
+ `rand_key` decimal(11,10) default NULL,
`relative_path_cache` varchar(255) default NULL,
`relative_url_cache` varchar(255) default NULL,
`resize_dirty` boolean default 1,
@@ -136,7 +136,7 @@ class gallery_installer {
`id` int(9) NOT NULL auto_increment,
`key` varchar(255) default NULL,
`severity` varchar(32) default NULL,
- `value` varchar(255) default NULL,
+ `value` text default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY(`key`))
DEFAULT CHARSET=utf8;");
@@ -259,6 +259,7 @@ class gallery_installer {
module::set_var("gallery", "default_locale", "en_US");
module::set_var("gallery", "image_quality", 75);
module::set_var("gallery", "image_sharpen", 15);
+ module::set_var("gallery", "upgrade_checker_auto_enabled", true);
// Add rules for generating our thumbnails and resizes
graphics::add_rule(
@@ -285,6 +286,7 @@ class gallery_installer {
block_manager::add("dashboard_sidebar", "gallery", "platform_info");
block_manager::add("dashboard_sidebar", "gallery", "project_news");
block_manager::add("dashboard_center", "gallery", "welcome");
+ block_manager::add("dashboard_center", "gallery", "upgrade_checker");
block_manager::add("dashboard_center", "gallery", "photo_stream");
block_manager::add("dashboard_center", "gallery", "log_entries");
@@ -309,7 +311,7 @@ class gallery_installer {
module::set_var("gallery", "show_user_profiles_to", "registered_users");
module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin");
- module::set_version("gallery", 43);
+ module::set_version("gallery", 46);
}
static function upgrade($version) {
@@ -653,6 +655,28 @@ class gallery_installer {
$db->query("ALTER TABLE {items} CHANGE `description` `description` text DEFAULT NULL");
module::set_version("gallery", $version = 43);
}
+
+ if ($version == 43) {
+ $db->query("ALTER TABLE {items} CHANGE `rand_key` `rand_key` DECIMAL(11, 10)");
+ module::set_version("gallery", $version = 44);
+ }
+
+ if ($version == 44) {
+ $db->query("ALTER TABLE {messages} CHANGE `value` `value` text default NULL");
+ module::set_version("gallery", $version = 45);
+ }
+
+ if ($version == 45) {
+ // Splice the upgrade_checker block into the admin dashboard at the top
+ // of the page, but under the welcome block if it's in the first position.
+ $blocks = block_manager::get_active("dashboard_center");
+ $index = count($blocks) && current($blocks) == array("gallery", "welcome") ? 1 : 0;
+ array_splice($blocks, $index, 0, array(random::int() => array("gallery", "upgrade_checker")));
+ block_manager::set_active("dashboard_center", $blocks);
+
+ module::set_var("gallery", "upgrade_checker_auto_enabled", true);
+ module::set_version("gallery", $version = 46);
+ }
}
static function uninstall() {