From bfca0c79030d5b8a18e41e8b80f5560ebaf6f202 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 12:00:49 -0700 Subject: Refactor the install/upgrade code to be more flexible. Add xxx_installer::upgrade($version) method so that upgrade stanzas are separate from install stanzas. In the old code, to do an upgrade meant that you had to re-evolve everything from the initial install because we'd step through each version's changes. But what we really want is for the initial install to start off in the perfect initial state, and the upgrades to do the work behind the scenes. So now the install() function gets things set up properly the first time, and the upgrade() function does any work to catch you up to the latest code. See gallery_installer.php for a good example. --- modules/info/helpers/info_installer.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/info/helpers') diff --git a/modules/info/helpers/info_installer.php b/modules/info/helpers/info_installer.php index 94fc22d0..e3e78b90 100644 --- a/modules/info/helpers/info_installer.php +++ b/modules/info/helpers/info_installer.php @@ -19,9 +19,6 @@ */ class info_installer { static function install() { - $version = module::get_version("info"); - if ($version == 0) { - module::set_version("info", 1); - } + module::set_version("info", 1); } } -- cgit v1.2.3 From b235fd6e5f2197869c8ef04637d990d2017a19bf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 28 Jun 2009 18:00:00 -0700 Subject: Pass the item into the block. --- modules/info/helpers/info_theme.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/info/helpers') diff --git a/modules/info/helpers/info_theme.php b/modules/info/helpers/info_theme.php index 151885b7..2a761fb4 100644 --- a/modules/info/helpers/info_theme.php +++ b/modules/info/helpers/info_theme.php @@ -22,6 +22,7 @@ class info_theme_Core { if ($theme->item()) { $block = new Block(); $block->css_id = "gMetadata"; + $block->item = $theme->item(); $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); $block->content = new View("info_block.html"); return $block; -- cgit v1.2.3 From 24f0c4bd1914e5dc62d4fef936c901227620abbe Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 28 Jun 2009 18:10:42 -0700 Subject: Undo my last change; it's not the right fix for the problem. --- modules/info/helpers/info_theme.php | 1 - modules/info/views/info_block.html.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/info/helpers') diff --git a/modules/info/helpers/info_theme.php b/modules/info/helpers/info_theme.php index 2a761fb4..151885b7 100644 --- a/modules/info/helpers/info_theme.php +++ b/modules/info/helpers/info_theme.php @@ -22,7 +22,6 @@ class info_theme_Core { if ($theme->item()) { $block = new Block(); $block->css_id = "gMetadata"; - $block->item = $theme->item(); $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); $block->content = new View("info_block.html"); return $block; diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index 3a96937c..db621006 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -32,4 +32,4 @@ - \ No newline at end of file + -- cgit v1.2.3