From a1f08342c8b8502197159a9fd78e48e6cead4ea0 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 31 Jul 2010 19:22:47 +0000 Subject: improved the upgrade system and moved albums to use an ordered list for images --- views/default/tidypics/admin/upgrade.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 views/default/tidypics/admin/upgrade.php (limited to 'views/default/tidypics/admin/upgrade.php') diff --git a/views/default/tidypics/admin/upgrade.php b/views/default/tidypics/admin/upgrade.php new file mode 100644 index 000000000..5a21aa136 --- /dev/null +++ b/views/default/tidypics/admin/upgrade.php @@ -0,0 +1,30 @@ +pluginspath}tidypics/version.php"; + +$upgrade_url = "{$vars['url']}action/tidypics/admin/upgrade"; +//$upgrade_url = elgg_add_action_tokens_to_url($upgrade_url); + +// determine whether an upgrade is required +$local_version = get_plugin_setting('version', 'tidypics'); +if ($local_version === FALSE) { + // no version set so either new install or really old one + if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) { + $local_version = 0; + } else { + set_plugin_setting('version', $local_version, 'tidypics'); + $local_version = $version; + } +} elseif ($local_version == '1.62') { + $local_version = 2010010101; + set_plugin_setting('version', $local_version, 'tidypics'); +} +if ($local_version == $version) { + // no upgrade required + return TRUE; +} + +echo elgg_view('output/url', array( 'text' => 'Upgrade', + 'href' => $upgrade_url, + 'is_action' => TRUE)); +echo '
'; \ No newline at end of file -- cgit v1.2.3