From efdd4b6544e14355f6ae0e6151c6f828271d3913 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 28 Nov 2011 07:50:23 -0500 Subject: working on album sorting --- views/default/forms/photos/album/sort.php | 28 ++++++++++++++++ views/default/js/photos/tidypics.php | 26 +++++++++++++++ views/default/tidypics/css.php | 6 ++++ views/default/tidypics/sort.php | 54 ------------------------------- 4 files changed, 60 insertions(+), 54 deletions(-) create mode 100644 views/default/forms/photos/album/sort.php create mode 100644 views/default/js/photos/tidypics.php delete mode 100644 views/default/tidypics/sort.php (limited to 'views/default') diff --git a/views/default/forms/photos/album/sort.php b/views/default/forms/photos/album/sort.php new file mode 100644 index 000000000..524112e0c --- /dev/null +++ b/views/default/forms/photos/album/sort.php @@ -0,0 +1,28 @@ +getImageList(); + +echo '
'; +echo elgg_echo('tidypics:sort:instruct'); +echo '
'; + +echo '
'; +echo elgg_view('input/hidden', array('name' => 'guids')); +echo elgg_view('input/hidden', array('name' => 'album_guid', 'value' => $album->guid)); +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo '
'; + +echo '
'; +echo ''; diff --git a/views/default/js/photos/tidypics.php b/views/default/js/photos/tidypics.php new file mode 100644 index 000000000..509d2116a --- /dev/null +++ b/views/default/js/photos/tidypics.php @@ -0,0 +1,26 @@ + + +elgg.provide('elgg.tidypics'); + +elgg.tidypics.init = function() { + $("#tidypics-sort").sortable({ + opacity: 0.7, + revert: true, + scroll: true + }); + + $('.elgg-form-photos-album-sort').submit(function() { + var tidypics_guids = []; + $("#tidypics-sort li").each(function(index) { + tidypics_guids.push($(this).attr('id')); + }); + $('input[name="guids"]').val(tidypics_guids.toString()); + }); +}; + +elgg.register_hook_handler('init', 'system', elgg.tidypics.init); diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index 542123bd0..82594db0e 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -22,6 +22,12 @@ width: 120px; } +#tidypics-sort li { +width:153px; +height:153px; +} + + diff --git a/views/default/tidypics/sort.php b/views/default/tidypics/sort.php deleted file mode 100644 index 66dd8a999..000000000 --- a/views/default/tidypics/sort.php +++ /dev/null @@ -1,54 +0,0 @@ -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'))); -?> -
-
- -
- 'tidypics_sort_form', - 'action' => "{$vars['url']}action/tidypics/sortalbum", - 'body' => $body, - ); - echo elgg_view('input/form', $params); - ?> - -
    - "; - } - ?> -
-
-
- - \ No newline at end of file -- cgit v1.2.3