From 73403645808a81425381f43c25e0ea2c92705312 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 25 Jul 2010 02:01:36 +0000 Subject: first go at brining tidypics up to code standards --- views/default/tidypics/forms/upload.php | 123 +++++++++++++++++--------------- 1 file changed, 64 insertions(+), 59 deletions(-) (limited to 'views/default/tidypics/forms/upload.php') diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php index 6e755612c..691d9701b 100644 --- a/views/default/tidypics/forms/upload.php +++ b/views/default/tidypics/forms/upload.php @@ -1,78 +1,83 @@ access_id; +global $CONFIG; - $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; - } +//this is for image uploads only. Image edits are handled by edit.php form + +$container_guid = get_input('container_guid'); +$album = get_entity($vars['album']); +$access_id = $album->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")) . ''; - } -?> + } + ?>

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

"{$vars['url']}action/tidypics/upload", - 'body' => $form_body, - 'internalid' => 'tidypicsUpload', - 'enctype' => 'multipart/form-data', - 'method' => 'post',)); +$form_body = ob_get_clean(); + +echo elgg_view('input/form', array( + 'action' => "{$vars['url']}action/tidypics/upload", + 'body' => $form_body, + 'internalid' => 'tidypicsUpload', + 'enctype' => 'multipart/form-data', + 'method' => 'post',) +); ?>
\ No newline at end of file -- cgit v1.2.3