From c7bd5fb64003c42f9299b7203af9a13bcd48948f Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 15:50:06 -0400 Subject: added quota back --- views/default/forms/photos/admin/settings.php | 14 +---------- views/default/forms/photos/admin/settings/main.php | 12 ++++++++++ views/default/forms/photos/ajax_upload.php | 23 ++++-------------- views/default/forms/photos/basic_upload.php | 27 ---------------------- views/default/photos/sidebar.php | 6 +++++ views/default/photos/sidebar/quota.php | 27 ++++++++++++++++++++++ 6 files changed, 51 insertions(+), 58 deletions(-) create mode 100644 views/default/photos/sidebar/quota.php (limited to 'views') diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php index 7e9c17ac2..403203f69 100644 --- a/views/default/forms/photos/admin/settings.php +++ b/views/default/forms/photos/admin/settings.php @@ -2,7 +2,7 @@ /** * Tidypics admin settings form body * - * @todo watermark, quota, remove original image, group only upload not delete + * @todo remove original image, group only upload not delete */ $plugin = elgg_get_plugin_from_id('tidypics'); @@ -24,15 +24,3 @@ $content = elgg_view('forms/photos/admin/settings/thumbnails', array('plugin' => echo elgg_view_module('inline', $title, $content); echo elgg_view('input/submit', array('value' => elgg_echo("save"))); - -return true; - - -// Quota Size -$quota = $plugin->quota; -if (!$quota) { - $quota = 0; -} -$form_body .= "

" . elgg_echo('tidypics:settings:quota') . "
"; -$form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "

"; - diff --git a/views/default/forms/photos/admin/settings/main.php b/views/default/forms/photos/admin/settings/main.php index 352a9c5a1..c99b9d688 100644 --- a/views/default/forms/photos/admin/settings/main.php +++ b/views/default/forms/photos/admin/settings/main.php @@ -34,3 +34,15 @@ echo elgg_view("input/text", array( 'value' => $plugin->watermark_text, )); echo ''; + +// Quota Size +$quota = $plugin->quota; +if (!$quota) { + $quota = 0; +} +echo '
' . elgg_echo('tidypics:settings:quota'); +echo elgg_view('input/text', array( + 'name' => 'params[quota]', + 'value' => $quota, +)); +echo '
'; diff --git a/views/default/forms/photos/ajax_upload.php b/views/default/forms/photos/ajax_upload.php index be25d628e..3ab578a38 100644 --- a/views/default/forms/photos/ajax_upload.php +++ b/views/default/forms/photos/ajax_upload.php @@ -17,26 +17,13 @@ if (!$maxfilesize) { $maxfilesize = 5; } -$quota = elgg_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; - } -} - ?> -

+

+ +