diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-07-14 15:50:06 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-07-14 15:50:06 -0400 |
commit | c7bd5fb64003c42f9299b7203af9a13bcd48948f (patch) | |
tree | d962c172af9395c734d345aa43d95561ea3ccf24 /views/default/forms/photos | |
parent | 2d8b04169dda48a5dba8503d9943bdeee2c64685 (diff) | |
download | elgg-c7bd5fb64003c42f9299b7203af9a13bcd48948f.tar.gz elgg-c7bd5fb64003c42f9299b7203af9a13bcd48948f.tar.bz2 |
added quota back
Diffstat (limited to 'views/default/forms/photos')
-rw-r--r-- | views/default/forms/photos/admin/settings.php | 14 | ||||
-rw-r--r-- | views/default/forms/photos/admin/settings/main.php | 12 | ||||
-rw-r--r-- | views/default/forms/photos/ajax_upload.php | 23 | ||||
-rw-r--r-- | views/default/forms/photos/basic_upload.php | 27 |
4 files changed, 18 insertions, 58 deletions
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 .= "<p>" . elgg_echo('tidypics:settings:quota') . "<br />"; -$form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "</p>"; - 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 '</div>'; + +// Quota Size +$quota = $plugin->quota; +if (!$quota) { + $quota = 0; +} +echo '<div>' . elgg_echo('tidypics:settings:quota'); +echo elgg_view('input/text', array( + 'name' => 'params[quota]', + 'value' => $quota, +)); +echo '</div>'; 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; - } -} - ?> -<p><?php echo elgg_echo('tidypics:uploader:instructs', array($basic_uploader_url)); ?></p> +<p> +<?php + echo elgg_echo('tidypics:uploader:instructs', array($maxfilesize, $basic_uploader_url)); +?> +</p> <ul id="tidypics-uploader-steps"> <li class="mbm"> diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php index e4535814b..ba849d1b4 100644 --- a/views/default/forms/photos/basic_upload.php +++ b/views/default/forms/photos/basic_upload.php @@ -15,33 +15,6 @@ $album = $vars['entity']; $access_id = $album->access_id; $maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics'); -$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; - } -} - <?php - if ($quota) { - ?> - <i><?php echo elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . " MB ({$quote_percentage}%)"; ?></i><br /> - <?php - } - ?> - - * -*/ $instructions = elgg_echo("tidypics:uploader:upload"); $max = elgg_echo('tidypics:uploader:basic', array($maxfilesize)); |