From a481a684b6c0fcfbf624e91f7e4bb483d1e6a45a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 30 Dec 2008 04:14:57 +0000 Subject: Add a "Graphics Settings" page that lets admins choose which graphics toolkit we use. We only allow users to use one toolkit. The UI needs work! --- core/controllers/admin_graphics.php | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 core/controllers/admin_graphics.php (limited to 'core/controllers') diff --git a/core/controllers/admin_graphics.php b/core/controllers/admin_graphics.php new file mode 100644 index 00000000..e6e42672 --- /dev/null +++ b/core/controllers/admin_graphics.php @@ -0,0 +1,48 @@ +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"); + print $view; + } + + public function save() { + access::verify_csrf(); + $toolkit = $this->input->post("graphics_toolkit"); + if ($toolkit != module::get_var("core", "graphics_toolkit")) { + module::set_var("core", "graphics_toolkit", $toolkit); + + $toolkit_info = graphics::detect_toolkits(); + if ($toolkit == "graphicsmagick" || $toolkit == "imagemagick") { + module::set_var("core", "graphics_toolkit_path", $toolkit_info[$toolkit]); + } + + site_status::clear("missing_graphics_toolkit"); + message::success(_("Updated Graphics Toolkit")); + log::success("graphics", sprintf(_("Changed graphics toolkit to %s"), $toolkit)); + } + + url::redirect("admin/graphics"); + } +} + -- cgit v1.2.3