aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-25 00:22:20 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-25 00:22:20 +0000
commit893364a28955358ad259bfb75798560616ab3d49 (patch)
tree8b2ac2fb618596fed82b12c221eb7c485cbb9590 /views
parentda1493b95a2f0b5000a487ae373c9318c58d0b2d (diff)
downloadelgg-893364a28955358ad259bfb75798560616ab3d49.tar.gz
elgg-893364a28955358ad259bfb75798560616ab3d49.tar.bz2
supporting both basic and flash uploader
Diffstat (limited to 'views')
-rw-r--r--views/default/tidypics/css.php27
-rw-r--r--views/default/tidypics/forms/ajax_upload.php36
-rw-r--r--views/default/tidypics/forms/edit_multi.php23
-rw-r--r--views/default/tidypics/forms/upload.php7
4 files changed, 66 insertions, 27 deletions
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php
index 9e5a5c68d..ea2081da6 100644
--- a/views/default/tidypics/css.php
+++ b/views/default/tidypics/css.php
@@ -304,7 +304,7 @@ list-style: none;
.uploadifyQueueItem {
background-color:#F5F5F5;
border:2px solid #E5E5E5;
-font:11px Verdana,Geneva,sans-serif;
+font-size:11px;
margin-top:5px;
padding:10px;
width:350px;
@@ -322,4 +322,27 @@ width:100%;
background-color: #0099FF;
width: 1px;
height: 3px;
-} \ No newline at end of file
+}
+
+#tidypics_uploader {
+position:relative;
+width:400px;
+}
+
+#tidypics_choose_button {
+position:absolute;
+top:0;
+left:0;
+z-index:0;
+display:block;
+float:left;
+}
+
+#tidypics_flash_uploader {
+position:relative;
+z-index:100;
+}
+
+#uploadifyQueue {
+margin-bottom: 20px;
+}
diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/tidypics/forms/ajax_upload.php
index b71068a13..25c658570 100644
--- a/views/default/tidypics/forms/ajax_upload.php
+++ b/views/default/tidypics/forms/ajax_upload.php
@@ -2,13 +2,14 @@
extend_view('metatags', 'tidypics/js/uploader');
-$container_guid = get_input('container_guid');
-$album = get_entity($vars['album']);
+$album = $vars['album'];
$access_id = $album->access_id;
$ts = time();
$token = generate_action_token($ts);
+$batch = time();
+
$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics');
if (!$maxfilesize) {
@@ -36,29 +37,46 @@ if ($quota) {
<div class="contentWrapper">
-<p>Instructions here for uploading images using Ajax/Flash</p>
-<input id="upload_file" name="upload_file" type="file" />
-<a href="javascript:$('#upload_file').uploadifyUpload();">Upload Files</a> |
-<a href="javascript:$('#upload_file').uploadifyClearQueue();">Clear Queue</a>
+ <p>Instructions here for uploading images using Ajax/Flash</p>
+
+ <div id="tidypics_uploader">
+ <a id="tidypics_choose_button">Choose images</a>
+ <div id="tidypics_flash_uploader">
+ <input type="file" id="uploadify" name="uploadify" />
+ </div>
+ </div>
+
+<a href="javascript:$('#uploadify').uploadifyUpload();">Upload Files</a>
+<!--
+<a href="javascript:$('#uploadify').uploadifyClearQueue();">Clear Queue</a>
+-->
+<br />
+<a href="<?php echo $vars['url']; ?>pg/photos/batch/<?php echo $batch; ?>">Add titles and descriptions</a>
+<br />
+<a href="<?php echo current_page_url(); ?>/basic">Basic uploader</a>
+
</div>
<script type="text/javascript">
-$("#upload_file").uploadify({
+$("#uploadify").uploadify({
'uploader' : '<?php echo $vars['url']; ?>mod/tidypics/vendors/uploadify/uploadify.swf',
'script' : '<?php echo $vars['url']; ?>action/tidypics/ajax_upload/',
'scriptData' : {
'album_guid' : '<?php echo $album->guid; ?>',
'__elgg_token' : '<?php echo $token; ?>',
'__elgg_ts' : '<?php echo $ts; ?>',
- 'Elgg' : '<?php echo session_id(); ?>'
+ 'Elgg' : '<?php echo session_id(); ?>',
+ 'batch' : '<?php echo $batch; ?>'
},
'fileDataName' : 'Image',
'cancelImg' : '/_images/cancel.png',
'multi' : true,
'auto' : false,
'fileDesc' : '<?php echo elgg_echo('tidypics:upload:filedesc'); ?>',
- 'fileExt' : '*.jpg;*.jpeg;*.png;*.gif'
+ 'fileExt' : '*.jpg;*.jpeg;*.png;*.gif',
+ 'wmode' : 'transparent',
+ 'buttonImg' : " "
});
</script>
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
index 8c3e40242..aba6fd324 100644
--- a/views/default/tidypics/forms/edit_multi.php
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -2,26 +2,25 @@
/**
* form for mass editing all uploaded images
*/
+
+$images = $vars['images'];
+$album = get_entity($images[0]->container_guid);
+
?>
<div class="contentWrapper">
<form action="<?php echo $vars['url']; ?>action/tidypics/edit_multi" method="post">
<?php
-
- $file_array = $vars['file_array'];
// make sure one of the images becomes the cover if there isn't one already
- $album_entity = get_entity($vars['album_guid']);
- if (!$album_entity->getCoverImageGuid()) {
+ if (!$album->getCoverImageGuid()) {
$no_cover = true;
}
- foreach ($file_array as $key => $file_guid) {
- $entity = get_entity($file_guid);
- $guid = $entity->guid;
- $body = $entity->description;
- $title = $entity->title;
- $tags = $entity->tags;
- $container_guid = $entity->container_guid;
+ foreach ($images as $key => $image) {
+ $guid = $image->guid;
+ $body = $image->description;
+ $title = $image->title;
+ $tags = $image->tags;
// first one is default cover if there isn't one already
if ($no_cover) {
@@ -54,7 +53,7 @@
}
?>
-<input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
+<input type="hidden" name="container_guid" value="<?php echo $album->guid; ?>" />
<p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
</form>
</div> \ No newline at end of file
diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php
index 691d9701b..5a9703171 100644
--- a/views/default/tidypics/forms/upload.php
+++ b/views/default/tidypics/forms/upload.php
@@ -3,8 +3,7 @@ global $CONFIG;
//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']);
+$album = $vars['album'];
$access_id = $album->access_id;
$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics');
@@ -59,8 +58,8 @@ if ($quota) {
</p>
<p>
<?php
- if ($container_guid) {
- echo '<input type="hidden" name="container_guid" value="' . $container_guid . '" />';
+ if ($album) {
+ echo '<input type="hidden" name="album_guid" value="' . $album->guid . '" />';
}
if ($access_id) {
echo '<input type="hidden" name="access_id" value="' . $access_id . '" />';