image_lib.php 962 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Test the location of ImageMagick
  4. */
  5. $content .= '<p>' . elgg_echo('tidypics:lib_tools:testing') . '</p>';
  6. $content .= '<p><label>' . elgg_echo('tidypics:settings:im_path');
  7. $content .= elgg_view('input/text', array(
  8. 'name' => 'im_location'
  9. ));
  10. $content .= '</p><p>';
  11. $content .= elgg_view('input/submit', array(
  12. 'value' => elgg_echo('submit'),
  13. 'id' => 'tidypics-im-test'
  14. ));
  15. $content .= '</p>';
  16. $content .= '<p id="tidypics-im-results"></p>';
  17. echo elgg_view_module('inline', 'ImageMagick', $content);
  18. ?>
  19. <script type="text/javascript">
  20. $(function() {
  21. $('#tidypics-im-test').click(function() {
  22. var loc = $('input[name=im_location]').val();
  23. $("#tidypics-im-results").html("");
  24. $.ajax({
  25. type: "GET",
  26. url: elgg.normalize_url('mod/tidypics/actions/photos/admin/imtest.php'),
  27. data: {location: loc},
  28. cache: false,
  29. success: function(html){
  30. $("#tidypics-im-results").html(html);
  31. }
  32. });
  33. });
  34. });
  35. </script>