From c9f5000e65f66b3342f2cc6e2e9623eac72ff223 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 8 Aug 2009 20:31:16 -0700 Subject: Improve the graphics toolkit detection code so that properly identifies situations where its restricted by open_basedir. We now track more informatoin about the toolkit including the version and any errors we encountered while doing the detection so that we can provide more info downstream. This makes graphics::detect_toolkits() a little heavier, but that's ok because it should not be called very often. In the process, refactor the controller and view hierarchy so that it's a little more straightforward in the code. Fixes ticket #616. --- modules/gallery/views/admin_graphics.html.php | 14 +++++++++++--- modules/gallery/views/admin_graphics_gd.html.php | 15 +++++++++------ .../gallery/views/admin_graphics_graphicsmagick.html.php | 10 +++++----- modules/gallery/views/admin_graphics_imagemagick.html.php | 12 ++++++------ modules/gallery/views/admin_graphics_none.html.php | 2 +- 5 files changed, 32 insertions(+), 21 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_graphics.html.php b/modules/gallery/views/admin_graphics.html.php index 08374471..c4a2f5c6 100644 --- a/modules/gallery/views/admin_graphics.html.php +++ b/modules/gallery/views/admin_graphics.html.php @@ -9,8 +9,8 @@ }; $("#gAdminGraphics div.gAvailable .gBlock").click(select_toolkit); }); - +

@@ -18,11 +18,19 @@

- + + + + $tk->$active, "is_active" => true)) ?> +

- + + + $tk->$id, "is_active" => false)) ?> + +
diff --git a/modules/gallery/views/admin_graphics_gd.html.php b/modules/gallery/views/admin_graphics_gd.html.php index b77da8e3..aa9ee67c 100644 --- a/modules/gallery/views/admin_graphics_gd.html.php +++ b/modules/gallery/views/admin_graphics_gd.html.php @@ -1,23 +1,26 @@ -
gd["GD Version"] ? " gInstalledToolkit" : " gUnavailable" ?>"> +
installed ? " gInstalledToolkit" : " gUnavailable" ?>"> " alt="" />

GD website for more information.", array("url" => "http://www.boutell.com/gd")) ?>

- gd["GD Version"] && function_exists('imagerotate')): ?> + installed && $tk->rotate): ?>

- $tk->gd["GD Version"])) ?> + $tk->version)) ?>

- gd["GD Version"]): ?> + installed): ?> + + error): ?>

- $tk->gd["GD Version"])) ?> + error ?>

+ +

diff --git a/modules/gallery/views/admin_graphics_graphicsmagick.html.php b/modules/gallery/views/admin_graphics_graphicsmagick.html.php index e2cd0777..bf3ad339 100644 --- a/modules/gallery/views/admin_graphics_graphicsmagick.html.php +++ b/modules/gallery/views/admin_graphics_graphicsmagick.html.php @@ -1,21 +1,21 @@ -
graphicsmagick ? " gInstalledToolkit" : " gUnavailable" ?>"> +
installed ? " gInstalledToolkit" : " gUnavailable" ?>">

" alt="" />

GraphicsMagick website for more information.", array("url" => "http://www.graphicsmagick.org")) ?>

- graphicsmagick): ?> + installed): ?>

- $tk->graphicsmagick)) ?> + $tk->version, "dir" => $tk->dir)) ?>

-

- +

+ error ?>

diff --git a/modules/gallery/views/admin_graphics_imagemagick.html.php b/modules/gallery/views/admin_graphics_imagemagick.html.php index 081ddc15..b8f7ffb8 100644 --- a/modules/gallery/views/admin_graphics_imagemagick.html.php +++ b/modules/gallery/views/admin_graphics_imagemagick.html.php @@ -1,21 +1,21 @@ -
imagemagick ? " gInstalledToolkit" : " gUnavailable" ?>"> +
installed ? " gInstalledToolkit" : " gUnavailable" ?>">

" alt="" />

ImageMagick website for more information.", array("url" => "http://www.imagemagick.org")) ?>

- imagemagick): ?> + installed): ?>

- $tk->imagemagick)) ?> + $tk->version, "dir" => $tk->dir)) ?>

- -

- + error): ?> +

+ error ?>

diff --git a/modules/gallery/views/admin_graphics_none.html.php b/modules/gallery/views/admin_graphics_none.html.php index 5306a70d..be2a580d 100644 --- a/modules/gallery/views/admin_graphics_none.html.php +++ b/modules/gallery/views/admin_graphics_none.html.php @@ -2,6 +2,6 @@

- +

-- cgit v1.2.3