diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-07-13 22:02:22 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-07-13 22:02:22 -0400 |
commit | 695651451b262c526d6aaf9d0988ce557ff50e95 (patch) | |
tree | 92afd91c81f851e78dd87af0e1f6c2f848f5a8b2 /views/default/admin/settings/tidypics/thumbnail.php | |
parent | a2e4f84be4da51b7ec8fbe625b1b26dde2ad9289 (diff) | |
parent | 67d855d73499f36f15331e1ff18cccd13aa8aa74 (diff) | |
download | elgg-695651451b262c526d6aaf9d0988ce557ff50e95.tar.gz elgg-695651451b262c526d6aaf9d0988ce557ff50e95.tar.bz2 |
Merging admin changes from Brett's repo
Diffstat (limited to 'views/default/admin/settings/tidypics/thumbnail.php')
-rw-r--r-- | views/default/admin/settings/tidypics/thumbnail.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/views/default/admin/settings/tidypics/thumbnail.php b/views/default/admin/settings/tidypics/thumbnail.php new file mode 100644 index 000000000..502b5739e --- /dev/null +++ b/views/default/admin/settings/tidypics/thumbnail.php @@ -0,0 +1,52 @@ +<?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> + $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 |