aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms/photos
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-02 21:44:44 +0200
committerSem <sembrestels@riseup.net>2012-08-02 21:44:44 +0200
commitdad0209bbd7994b623bc0126e3e37b1f521d2977 (patch)
tree1e954b32439cbfc2acbbd63ed62dc372a260f37e /views/default/forms/photos
parentfa81c487488064f684649272a6579079d3a88e2c (diff)
parent28b1669c4b1afaed7429da2cc9580340dcb13b6e (diff)
downloadelgg-dad0209bbd7994b623bc0126e3e37b1f521d2977.tar.gz
elgg-dad0209bbd7994b623bc0126e3e37b1f521d2977.tar.bz2
Merge branch 'jquery-uploader' of git://github.com/sembrestels/Tidypics
Conflicts: start.php views/default/photos/css.php
Diffstat (limited to 'views/default/forms/photos')
-rw-r--r--views/default/forms/photos/basic_upload.php75
1 files changed, 45 insertions, 30 deletions
diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php
index ba849d1b4..9e71cf59e 100644
--- a/views/default/forms/photos/basic_upload.php
+++ b/views/default/forms/photos/basic_upload.php
@@ -1,48 +1,63 @@
<?php
-/**
- * Basic uploader form
- *
- * This only handled uploading the images. Editing the titles and descriptions
- * are handled with the edit forms.
- *
- * @uses $vars['entity']
- *
- * @author Cash Costello
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
- */
-
$album = $vars['entity'];
-$access_id = $album->access_id;
+$help = elgg_echo('tidypics:uploader:help');
-$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics');
+$input = elgg_view('input/file', array(
+ 'name' => 'images[]',
+ 'multiple' => 'multiple',
+ 'class' => 'hidden-js',
+));
-$instructions = elgg_echo("tidypics:uploader:upload");
-$max = elgg_echo('tidypics:uploader:basic', array($maxfilesize));
+$button = elgg_view('output/url', array(
+ 'text' => elgg_echo('tidypics:uploader:upload') . $input,
+ 'class' => 'elgg-button elgg-button-action fileinput-button',
+));
-$list = '';
-for ($x = 0; $x < 10; $x++) {
- $list .= '<li>' . elgg_view('input/file', array('name' => 'images[]')) . '</li>';
-}
+$reset = elgg_view('input/reset', array(
+ 'value' => elgg_echo('cancel'),
+ 'class' => 'hidden',
+));
$foot = elgg_view('input/hidden', array('name' => 'guid', 'value' => $album->getGUID()));
$foot .= elgg_view('input/submit', array('value' => elgg_echo("save")));
-$form_body = <<<HTML
+echo <<<HTML
<div>
$max
</div>
-<div>
- <ol>
- $list
- </ol>
+<div class="fileinput-container">
+ $button
+ $reset
+ <p class="elgg-text-help">$help</p>
+</div>
+<div class="mtm"><!-- The table listing the files available for upload/download -->
+ <table role="presentation" class="elgg-table-alt clearfloat mtm">
+ <tbody class="files"></tbody>
+ </table>
</div>
<div class='elgg-foot'>
$foot
</div>
HTML;
-echo elgg_view('input/form', array(
- 'body' => $form_body,
- 'action' => 'action/photos/image/upload',
- 'enctype' => 'multipart/form-data',
-));
+?>
+
+<noscript><style type="text/css">hidden-nojs {display: hidden}</style></noscript>
+
+<!-- The template to display files available for upload -->
+<script id="template-upload" type="text/x-tmpl">
+{% for (var i=0, file; file=o.files[i]; i++) { %}
+ <tr class="template-upload fade">
+ {% if (file.error) { %}
+ <td class="error"><span class="elgg-message elgg-state-error">{%=locale.fileupload.error%} {%=locale.fileupload.errors[file.error] || file.error%}</span></td>
+ {% } else { %}
+ <td class="preview"><span class="fade"></span></td>
+ {% } %}
+ <td class="name"><span>{%=file.name%}</span></td>
+ <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
+
+ </tr>
+{% } %}
+</script>
+<!-- The template to display files available for download -->
+<script id="template-download" type="text/x-tmpl" />