]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added quota message
authorCash Costello <cash.costello@gmail.com>
Sun, 21 Jun 2009 13:26:48 +0000 (13:26 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 21 Jun 2009 13:26:48 +0000 (13:26 +0000)
languages/en.php
views/default/tidypics/forms/upload.php

index 9d39c64c6b6cebb0570564818cf2fbcc2ae538cc..e0201dc4619ab40b572bd93720c8d19294f43146 100644 (file)
@@ -80,8 +80,7 @@
                        'album:desc' => "Description",\r
                        'album:tags' => "Tags",\r
                        'album:cover' => "Make image album cover?",\r
-                       'album:cover:yes' => "Yes",\r
-                       'image:access:note' => "(view access is inherited from the album)",\r
+                       'tidypics:quota' => "Quota usage:",\r
                        \r
                //views \r
                \r
                        'images:edited' => "Your images were successfully updated.",\r
                        'album:edited' => "Your album was successfully updated.",\r
                        'album:saved' => "Your album was successfully saved.",\r
-                       'album:deleted' => "Your album was successfully deleted.",      \r
+                       'album:deleted' => "Your album was successfully deleted.",\r
                        'album:delete:confirm' => "Are you sure you want to delete this album?",\r
                        'album:created' => "Your new album has been created.",\r
-                       'tidypics:status:processing' => "Please wait while we process your picture....",\r
                        'tidypics:settings:save:ok' => 'Successfully saved the Tidypics plugin settings',\r
                                \r
                //Error messages\r
index a8f3c83869eb32209054ffdac923d5cdfce800f6..c4313bf407d1ae8f7e9ee7d1967a1f0df8531ffc 100644 (file)
@@ -4,11 +4,21 @@
        //this is for image uploads only. Image edits are handled by edit.php form
        
        $container_guid = get_input('container_guid');
-       $access_id = get_entity($vars['album'])->access_id;
+       $album = get_entity($vars['album']);
+       $access_id = $album->access_id;
 
        $maxfilesize = (int) 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 = round($image_repo_size / 1024 / 1024);
+               if ($image_repo_size > $quota)
+                       $image_repo_size = $quota;
+       }
 
 ?>
 <div id="tidypics_ref"></div>
 <p style="line-height:1.6em;">
        <label><?php echo elgg_echo("images:upload"); ?></label><br />
        <i><?php echo elgg_echo("tidypics:settings:maxfilesize") . ' ' . $maxfilesize; ?></i><br />
+<?php 
+       if ($quota) {
+?>
+       <i><?php echo elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . ' MB'; ?></i><br />
+<?php
+       }
+?>
        <div class="tidypics_popup">
                Uploading images<br />
                <div style="margin:20px 0px 20px 80px;"><img alt="..." border="0" src="<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>" /></div>