From b46b9b1464249916d105ee46f0bdb7972863070d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 10 Nov 2011 07:00:44 -0500 Subject: moved upload forms to new location --- views/default/forms/tidypics/ajax_upload.php | 141 ++++++++++++++++++++++++++ views/default/forms/tidypics/basic_upload.php | 104 +++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 views/default/forms/tidypics/ajax_upload.php create mode 100644 views/default/forms/tidypics/basic_upload.php (limited to 'views/default/forms') diff --git a/views/default/forms/tidypics/ajax_upload.php b/views/default/forms/tidypics/ajax_upload.php new file mode 100644 index 000000000..a1d13e80b --- /dev/null +++ b/views/default/forms/tidypics/ajax_upload.php @@ -0,0 +1,141 @@ +salt); + +$basic_uploader_url = current_page_url() . '/basic'; +$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/"; +$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/"; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> + +
+ +

+ + +
+ + diff --git a/views/default/forms/tidypics/basic_upload.php b/views/default/forms/tidypics/basic_upload.php new file mode 100644 index 000000000..55ab854a4 --- /dev/null +++ b/views/default/forms/tidypics/basic_upload.php @@ -0,0 +1,104 @@ +access_id; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> +
+
+ +

+
+
+ +
+ +

+
+
...
+
+
    + ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; + } + ?> +
+

+

+ guid . '" />'; + } + if ($access_id) { + echo ''; + } + ?> + " onclick="displayProgress();" /> +

+ +
+ \ No newline at end of file -- cgit v1.2.3