From 16bebdca068eebedb1eea71e04d986936561e8fc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 13 Jan 2009 04:56:29 +0000 Subject: Make the admin/graphics UI mimic admin/themes with a single selected toolkit above, and other available ones below. --- core/controllers/admin_graphics.php | 19 ++++- core/views/admin_graphics.html.php | 96 ++++------------------- core/views/admin_graphics_gd.html.php | 22 ++++++ core/views/admin_graphics_graphicsmagick.html.php | 17 ++++ core/views/admin_graphics_imagemagick.html.php | 17 ++++ 5 files changed, 89 insertions(+), 82 deletions(-) create mode 100644 core/views/admin_graphics_gd.html.php create mode 100644 core/views/admin_graphics_graphicsmagick.html.php create mode 100644 core/views/admin_graphics_imagemagick.html.php (limited to 'core') 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(" /> - -

-

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

- gd["GD Version"] && function_exists('imagerotate')): ?> -

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

- gd["GD Version"]): ?> -

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

- -

- -

- -
- <? t(" /> - -

-

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

- imagemagick): ?> -

- $tk->imagemagick)) ?> -

- -

- -

- -
- <? t(" /> - -

-

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

- graphicsmagick): ?> -

- $tk->graphicsmagick)) ?> -

- -

- -

- -
diff --git a/core/views/admin_graphics_gd.html.php b/core/views/admin_graphics_gd.html.php new file mode 100644 index 00000000..822c63b0 --- /dev/null +++ b/core/views/admin_graphics_gd.html.php @@ -0,0 +1,22 @@ +
"> + " /> +

+

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

+ gd["GD Version"] && function_exists('imagerotate')): ?> +

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

+ gd["GD Version"]): ?> +

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

+ +

+ +

+ +
diff --git a/core/views/admin_graphics_graphicsmagick.html.php b/core/views/admin_graphics_graphicsmagick.html.php new file mode 100644 index 00000000..d65a1d3c --- /dev/null +++ b/core/views/admin_graphics_graphicsmagick.html.php @@ -0,0 +1,17 @@ +
"> +

+ " /> +

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

+ graphicsmagick): ?> +

+ $tk->graphicsmagick)) ?> +

+ +

+ +

+ +
diff --git a/core/views/admin_graphics_imagemagick.html.php b/core/views/admin_graphics_imagemagick.html.php new file mode 100644 index 00000000..24cdfb02 --- /dev/null +++ b/core/views/admin_graphics_imagemagick.html.php @@ -0,0 +1,17 @@ +
"> +

+ " /> +

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

+ imagemagick): ?> +

+ $tk->imagemagick)) ?> +

+ +

+ +

+ +
-- cgit v1.2.3