aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/forms/photos/album/sort.php28
-rw-r--r--views/default/js/photos/tidypics.php26
-rw-r--r--views/default/tidypics/css.php6
-rw-r--r--views/default/tidypics/sort.php54
-rw-r--r--views/rss/object/album.php4
-rw-r--r--views/rss/object/album/full.php3
6 files changed, 66 insertions, 55 deletions
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 @@
+<?php
+/**
+ * Album sorting view
+ */
+
+$album = $vars['album'];
+$image_guids = $album->getImageList();
+
+echo '<div>';
+echo elgg_echo('tidypics:sort:instruct');
+echo '</div>';
+
+echo '<div>';
+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 '</div>';
+
+echo '<div class="elgg-foot">';
+echo '<ul id="tidypics-sort" class="elgg-gallery">';
+foreach ($image_guids as $image_guid) {
+ $image = get_entity($image_guid);
+ $img = elgg_view('output/img', array(
+ 'src' => $image->getSrcURL(),
+ ));
+ echo "<li class=\"mam\" id=\"$image_guid\">$img</li>";
+}
+echo '</ul>';
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 @@
+<?php
+/**
+ *
+ */
+
+?>
+
+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;
+}
+
+
<?php
return true;
?>
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 @@
-<?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
diff --git a/views/rss/object/album.php b/views/rss/object/album.php
index 0c4606245..f880b56d6 100644
--- a/views/rss/object/album.php
+++ b/views/rss/object/album.php
@@ -3,9 +3,11 @@
* Album RSS view
*
* @uses $vars['entity'] TidypicsAlbum
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
*/
-
$full_view = elgg_extract('full_view', $vars, false);
if ($full_view) {
diff --git a/views/rss/object/album/full.php b/views/rss/object/album/full.php
index 8261e5ce0..b1f5a567b 100644
--- a/views/rss/object/album/full.php
+++ b/views/rss/object/album/full.php
@@ -3,6 +3,9 @@
* List photos in an album for RSS
*
* @uses $vars['entity'] TidypicsAlbum
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
*/
$limit = (int)get_input('limit', 20);