diff options
author | Cash Costello <cash.costello@gmail.com> | 2010-10-31 20:03:50 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2010-10-31 20:03:50 +0000 |
commit | 243e836190128b14e1c5aa53b6d01b6771b19d8c (patch) | |
tree | 7e426606f124790c6ec31dc5da0c7f09a41dcc67 /views/default | |
parent | 92ec25ec441330323e4fcbdfa33ebcf900420097 (diff) | |
download | elgg-243e836190128b14e1c5aa53b6d01b6771b19d8c.tar.gz elgg-243e836190128b14e1c5aa53b6d01b6771b19d8c.tar.bz2 |
First cut at a album sorting interface
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/tidypics/css.php | 20 | ||||
-rw-r--r-- | views/default/tidypics/sort.php | 54 |
2 files changed, 73 insertions, 1 deletions
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index f7dd256a1..abcdc86a9 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -384,4 +384,22 @@ float: right; .uploadifyError { border: 2px solid #FBCBBC; background-color: #FDE5DD; -}
\ No newline at end of file +} + +#tidypics_album_sort { +padding:0; +margin:0; +} + +#tidypics_album_sort li { +float:left; +margin:3px; +width:161px; +height:161px; +} + +#tidypics_album_sort img { +border:1px solid #dedede; +padding:4px; +} + diff --git a/views/default/tidypics/sort.php b/views/default/tidypics/sort.php new file mode 100644 index 000000000..66dd8a999 --- /dev/null +++ b/views/default/tidypics/sort.php @@ -0,0 +1,54 @@ +<?php +/** + * Album sorting view + */ + +$album = $vars['album']; +$image_guids = $album->getImageList(); + +// create submission form +$body = elgg_view('input/hidden', array('internalname' => 'guids')); +$body .= elgg_view('input/hidden', array('internalname' => 'album_guid', 'value' => $album->guid)); +$body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); +?> +<div class="contentWrapper"> + <div> + <?php echo elgg_echo('tidypics:sort:instruct'); ?> + </div> + <?php + $params = array( + 'internalid' => 'tidypics_sort_form', + 'action' => "{$vars['url']}action/tidypics/sortalbum", + 'body' => $body, + ); + echo elgg_view('input/form', $params); + ?> + + <ul id="tidypics_album_sort"> + <?php + foreach ($image_guids as $image_guid) { + $image = get_entity($image_guid); + $url = "{$vars['url']}pg/photos/thumbnail/$image_guid/small/"; + echo "<li id=\"$image_guid\"><img src=\"$url\" /></li>"; + } + ?> + </ul> + <div class="clearfloat"></div> +</div> + +<script type="text/javascript"> +$("#tidypics_album_sort").sortable( + { + opacity: 0.7, + revert: true, + scroll: true + } +); +$('#tidypics_sort_form').submit(function() { + var tidypics_guids = []; + $("#tidypics_album_sort li").each(function(index) { + tidypics_guids.push($(this).attr('id')); + }); + $('input[name="guids"]').val(tidypics_guids.toString()); +}); +</script>
\ No newline at end of file |