From 04fe9da19036a657aeeee11f6c3641f98a345323 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 5 Feb 2009 23:29:44 +0000 Subject: Addressed the issues in ticket 34. Surround the the attempt to use gd_info with a try catch block. Created a new class gInstalledToolkit which has the highlighting and the over pointer definition. Now if you mouse across an inactive toolkit it remains inert. --- core/helpers/graphics.php | 7 ++++++- core/views/admin_graphics_gd.html.php | 2 +- core/views/admin_graphics_graphicsmagick.html.php | 2 +- core/views/admin_graphics_imagemagick.html.php | 2 +- themes/admin_default/css/screen.css | 10 +--------- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 9954bf22..cd112e1b 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -236,7 +236,12 @@ class graphics_Core { * GraphicsMagick we return the path to the directory containing the appropriate binaries. */ static function detect_toolkits() { - return array("gd" => function_exists("gd_info") ? gd_info() : array(), + try { + $gd = function_exists("gd_info") ? gd_info() : array(); + } catch (Exception $e) { + $gd = array(); + } + return array("gd" => $gd, "imagemagick" => dirname(exec("which convert")), "graphicsmagick" => dirname(exec("which gm"))); } diff --git a/core/views/admin_graphics_gd.html.php b/core/views/admin_graphics_gd.html.php index 605e09ff..76933861 100644 --- a/core/views/admin_graphics_gd.html.php +++ b/core/views/admin_graphics_gd.html.php @@ -1,5 +1,5 @@ -
gd["GD Version"] ? "" : " gUnavailable" ?>"> +
gd["GD Version"] ? " gInstalledToolkit" : " gUnavailable" ?>"> " alt="" />

diff --git a/core/views/admin_graphics_graphicsmagick.html.php b/core/views/admin_graphics_graphicsmagick.html.php index 8196289e..2f4ce95c 100644 --- a/core/views/admin_graphics_graphicsmagick.html.php +++ b/core/views/admin_graphics_graphicsmagick.html.php @@ -1,5 +1,5 @@ -

graphicsmagick ? "" : " gUnavailable" ?>"> +
graphicsmagick ? " gInstalledToolkit" : " gUnavailable" ?>">

" alt="" />

diff --git a/core/views/admin_graphics_imagemagick.html.php b/core/views/admin_graphics_imagemagick.html.php index 1166ff71..4f77a794 100644 --- a/core/views/admin_graphics_imagemagick.html.php +++ b/core/views/admin_graphics_imagemagick.html.php @@ -1,5 +1,5 @@ -

imagemagick ? "" : " gUnavailable" ?>"> +
imagemagick ? " gInstalledToolkit" : " gUnavailable" ?>">

" alt="" />

diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index 670f9afc..964d87db 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -48,11 +48,8 @@ td { background: #e8e8e8; } -.gAvailable .gBlock { +.gAvailable .gInstalledToolkit:hover { cursor: pointer; -} - -.gAvailable .gBlock:hover { background: #eee; } @@ -61,11 +58,6 @@ td { opacity: 0.4; } -.gUnavailable:hover { - border-color: #ccc; - opacity: 1; -} - .gOddRow { background-color: #eee; } -- cgit v1.2.3