aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/settings/photos/thumbnail.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-14 12:49:21 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-14 12:49:21 -0400
commitf7f38da31ca53c25775d1a28668a1dd9aefd5277 (patch)
tree7d5512e5db79ab8ca589c90978e4a9052fbec70f /views/default/admin/settings/photos/thumbnail.php
parente52870068d67a2360769f76a13d35318a8ec14ef (diff)
downloadelgg-f7f38da31ca53c25775d1a28668a1dd9aefd5277.tar.gz
elgg-f7f38da31ca53c25775d1a28668a1dd9aefd5277.tar.bz2
cleaning up the admin area
Diffstat (limited to 'views/default/admin/settings/photos/thumbnail.php')
-rw-r--r--views/default/admin/settings/photos/thumbnail.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/views/default/admin/settings/photos/thumbnail.php b/views/default/admin/settings/photos/thumbnail.php
new file mode 100644
index 000000000..5f9769e91
--- /dev/null
+++ b/views/default/admin/settings/photos/thumbnail.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Tidypics thumbnail creation tool
+ */
+
+$title = elgg_echo('tidypics:settings:thumbnail');
+$body = '<p>' . elgg_echo('tidypics:thumbnail_tool_blurb') . '</p>';
+$im_id = elgg_echo('tidypics:settings:im_id');
+$input = elgg_view('input/text', array(
+ 'name' => 'image_id'
+));
+$submit = elgg_view('input/submit', array(
+ 'value' => elgg_echo('submit'),
+ 'id' => 'elgg-tidypics-im-test'
+));
+
+$body .=<<<HTML
+ <p>
+ <label>$im_id $input</label>
+ </p>
+ <p>
+ $submit
+ <div id="elgg-tidypics-im-results"></div>
+ </p>
+HTML;
+
+echo elgg_view_module('inline', $title, $body);
+
+?>
+
+<script type="text/javascript">
+ $(function() {
+ $('#elgg-tidypics-im-test').click(function() {
+ var image_id = $('input[name=image_id]').val();
+ $("#elgg-tidypics-im-results").html('<div class="elgg-ajax-loader"></div>');
+ elgg.action('photos/admin/create_thumbnails', {
+ format: 'JSON',
+ data: {guid: image_id},
+ cache: false,
+ success: function(result) {
+ // error
+ if (result.status < 0) {
+ var html = '';
+ } else {
+ var html = '<img class="elgg-photo tidypics-photo" src="'
+ + result.output.thumbnail_src + '" alt="' + result.output.title
+ + '" />';
+ }
+ $("#elgg-tidypics-im-results").html(html);
+ }
+ });
+ });
+ });
+</script> \ No newline at end of file