aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics/admin/upgrade.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-07-31 19:22:47 +0000
committerCash Costello <cash.costello@gmail.com>2010-07-31 19:22:47 +0000
commita1f08342c8b8502197159a9fd78e48e6cead4ea0 (patch)
treeea2e0c175ea7a9f4495b185162585e8d84bb8ed2 /views/default/tidypics/admin/upgrade.php
parent28e545574f35f0d6349a395648a7857ee58989c9 (diff)
downloadelgg-a1f08342c8b8502197159a9fd78e48e6cead4ea0.tar.gz
elgg-a1f08342c8b8502197159a9fd78e48e6cead4ea0.tar.bz2
improved the upgrade system and moved albums to use an ordered list for images
Diffstat (limited to 'views/default/tidypics/admin/upgrade.php')
-rw-r--r--views/default/tidypics/admin/upgrade.php30
1 files changed, 30 insertions, 0 deletions
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 @@
+<?php
+
+require_once "{$CONFIG->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 '<br />'; \ No newline at end of file