diff --git a/core/controllers/admin_graphics.php b/core/controllers/admin_graphics.php index ba1c7569..69a83575 100644 --- a/core/controllers/admin_graphics.php +++ b/core/controllers/admin_graphics.php @@ -21,8 +21,20 @@ class Admin_Graphics_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); $view->content = new View("admin_graphics.html"); - $view->content->tk = new ArrayObject(graphics::detect_toolkits(), ArrayObject::ARRAY_AS_PROPS); - $view->content->active = module::get_var("core", "graphics_toolkit"); + + $tk = new ArrayObject(graphics::detect_toolkits(), ArrayObject::ARRAY_AS_PROPS); + $active = module::get_var("core", "graphics_toolkit"); + foreach (array("gd", "imagemagick", "graphicsmagick") as $id) { + if ($id == $active) { + $view->content->active = new View("admin_graphics_$id.html"); + $view->content->active->tk = $tk; + } else { + $v = new View("admin_graphics_$id.html"); + $v->tk = $tk; + $view->content->available .= $v; + } + } + print $view; } @@ -38,7 +50,8 @@ class Admin_Graphics_Controller extends Admin_Controller { site_status::clear("missing_graphics_toolkit"); message::success(t("Updated Graphics Toolkit")); - log::success("graphics", t("Changed graphics toolkit to: {{toolkit}}", array("toolkit" => $toolkit))); + log::success("graphics", t("Changed graphics toolkit to: {{toolkit}}", + array("toolkit" => $toolkit))); } url::redirect("admin/graphics"); diff --git a/core/views/admin_graphics.html.php b/core/views/admin_graphics.html.php index 22108cd7..c5e32320 100644 --- a/core/views/admin_graphics.html.php +++ b/core/views/admin_graphics.html.php @@ -2,91 +2,29 @@ +
+ = t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?> +
-- = t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?> -
+
- " />
- |
-
- = t("GD") ?>-- = t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the GD website for more information.", - array("url" => "http://www.boutell.com/gd")) ?> - - if ($tk->gd["GD Version"] && function_exists('imagerotate')): ?> -- = t("You have GD version {{version}}.", array("version" => $tk->gd["GD Version"])) ?> - - elseif ($tk->gd["GD Version"]): ?> -- = t("You have GD version {{version}}, but it lacks image rotation.", - array("version" => $tk->gd["GD Version"])) ?> - - else: ?> -- = t("You do not have GD installed.") ?> - - endif ?> - |
-
- " />
- |
-
- = t("ImageMagick") ?>-- = t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the ImageMagick website for more information.", - array("url" => "http://www.imagemagick.org")) ?> - - if ($tk->imagemagick): ?> -- = t("You have ImageMagick installed in {{path}}", array("path" => $tk->imagemagick)) ?> - - else: ?> -- = t("ImageMagick is not available on your system.") ?> - - endif ?> - |
-
- " />
- |
-
- = t("GraphicsMagick") ?>-- = t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the GraphicsMagick website for more information.", - array("url" => "http://www.graphicsmagick.org")) ?> - - if ($tk->graphicsmagick): ?> -- = t("You have GraphicsMagick installed in {{path}}", array("path" => $tk->graphicsmagick)) ?> - - else: ?> -- = t("GraphicsMagick is not available on your system.") ?> - - endif ?> - |
-
" />
+ + = t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the GD website for more information.", + array("url" => "http://www.boutell.com/gd")) ?> +
+ if ($tk->gd["GD Version"] && function_exists('imagerotate')): ?> ++ = t("You have GD version {{version}}.", array("version" => $tk->gd["GD Version"])) ?> +
+ elseif ($tk->gd["GD Version"]): ?> ++ = t("You have GD version {{version}}, but it lacks image rotation.", + array("version" => $tk->gd["GD Version"])) ?> +
+ else: ?> ++ = t("You do not have GD installed.") ?> +
+ endif ?> +
" />
+ + = t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the GraphicsMagick website for more information.", + array("url" => "http://www.graphicsmagick.org")) ?> +
+ if ($tk->graphicsmagick): ?> ++ = t("GraphicsMagick is available in {{path}}", array("path" => $tk->graphicsmagick)) ?> +
+ else: ?> ++ = t("GraphicsMagick is not available on your system.") ?> +
+ endif ?> +
" />
+ + = t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the ImageMagick website for more information.", + array("url" => "http://www.imagemagick.org")) ?> +
+ if ($tk->imagemagick): ?> ++ = t("ImageMagick is available in {{path}}", array("path" => $tk->imagemagick)) ?> +
+ else: ?> ++ = t("ImageMagick is not available on your system.") ?> +
+ endif ?> +