From 65f6184aec8f6c6e5d053d4cb0e0925b9f536570 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Thu, 9 Feb 2012 10:24:59 -0800 Subject: Using tabs for admin pages. --- actions/admin/create_thumbnails.php | 60 ------------------------- actions/admin/imtest.php | 18 -------- actions/photos/admin/create_thumbnails.php | 70 ++++++++++++++++++++++++++++++ actions/photos/admin/imtest.php | 18 ++++++++ 4 files changed, 88 insertions(+), 78 deletions(-) delete mode 100644 actions/admin/create_thumbnails.php delete mode 100644 actions/admin/imtest.php create mode 100644 actions/photos/admin/create_thumbnails.php create mode 100644 actions/photos/admin/imtest.php (limited to 'actions') diff --git a/actions/admin/create_thumbnails.php b/actions/admin/create_thumbnails.php deleted file mode 100644 index a09965f65..000000000 --- a/actions/admin/create_thumbnails.php +++ /dev/null @@ -1,60 +0,0 @@ -getFilename(); -$container_guid = $image->container_guid; -if (!$filename || !$container_guid) { - echo "Error retrieving information about the image"; - return; -} - -$title = $image->title; -$prefix = "image/$container_guid/"; -$filestorename = substr($filename, strlen($prefix)); - -$image_lib = get_plugin_setting('image_lib', 'tidypics'); -if (!$image_lib) { - $image_lib = "GD"; -} - -if ($image_lib == 'ImageMagick') { // ImageMagick command line - - if (tp_create_im_cmdline_thumbnails($image, $prefix, $filestorename) != true) { - trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING); - echo "Failed to create thumbnails"; - } - -} else if ($image_lib == 'ImageMagickPHP') { // imagick PHP extension - - if (tp_create_imagick_thumbnails($image, $prefix, $filestorename) != true) { - trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING); - echo "Failed to create thumbnails"; - } - -} else { - - if (tp_create_gd_thumbnails($image, $prefix, $filestorename) != true) { - trigger_error('Tidypics warning: failed to create thumbnails - GD', E_USER_WARNING); - echo "Failed to create thumbnails"; - } - -} // end of image library selector - -echo "wwwroot}mod/tidypics/thumbnail.php?file_guid={$guid}&size=large\" alt=\"{$title}\" />"; diff --git a/actions/admin/imtest.php b/actions/admin/imtest.php deleted file mode 100644 index a58643d0e..000000000 --- a/actions/admin/imtest.php +++ /dev/null @@ -1,18 +0,0 @@ -getFilename(); +$container_guid = $image->container_guid; +if (!$filename || !$container_guid) { + register_error(elgg_echo('tidypics:thumbnail_tool:invalid_image_info')); + forward(REFERER); +} + +$title = $image->title; +$prefix = "image/$container_guid/"; +$filestorename = substr($filename, strlen($prefix)); + +$image_lib = elgg_get_plugin_setting('image_lib', 'tidypics'); +if (!$image_lib) { + $image_lib = "GD"; +} + +// ImageMagick command line +if ($image_lib == 'ImageMagick') { + if (!tp_create_im_cmdline_thumbnails($image, $prefix, $filestorename)) { + trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING); + register_error(elgg_echo('tidypics:thumbnail_tool:create_failed')); + forward(REFERER); + } + +// imagick PHP extension +} else if ($image_lib == 'ImageMagickPHP') { + if (!tp_create_imagick_thumbnails($image, $prefix, $filestorename)) { + trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING); + register_error(elgg_echo('tidypics:thumbnail_tool:create_failed')); + forward(REFERER); + } +// gd +} else { + if (!tp_create_gd_thumbnails($image, $prefix, $filestorename)) { + trigger_error('Tidypics warning: failed to create thumbnails - GD', E_USER_WARNING); + register_error(elgg_echo('tidypics:thumbnail_tool:create_failed')); + forward(REFERER); + } +} + +$url = elgg_normalize_url("photos/thumbnail/$guid/large"); +system_message(elgg_echo('tidypics:thumbnail_tool:created')); + +if (elgg_is_xhr()) { + echo json_encode(array( + 'guid' => $guid, + 'title' => $title, + 'thumbnail_src' => $url + )); +} + +forward(REFERER); \ No newline at end of file diff --git a/actions/photos/admin/imtest.php b/actions/photos/admin/imtest.php new file mode 100644 index 000000000..a58643d0e --- /dev/null +++ b/actions/photos/admin/imtest.php @@ -0,0 +1,18 @@ +