From 393273eaef4798cb4d03c73c4853edfb5903608b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 6 Jan 2009 09:30:32 +0000 Subject: Add graphics::Can() to let us determine whether the active toolkit supports a given function. Right now it's hardcoded to support what we know about GD. --- core/helpers/graphics.php | 15 +++++++++++++++ core/views/quick_pane.html.php | 6 ++++++ 2 files changed, 21 insertions(+) (limited to 'core') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 53cf01db..d36a2421 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -304,4 +304,19 @@ class graphics_Core { self::$init = 1; } + + /** + * Verify that a specific graphics function is available with the active toolkit. + * @param string $function the function name (eg rotate, resize) + * @return boolean + */ + function can($function) { + if (module::get_var("core", "graphics_toolkit") == "gd" && + $function == "rotate" && + !function_exists("imagerotate")) { + return false; + } + + return true; + } } diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php index 88da9d3e..7ae0a856 100644 --- a/core/views/quick_pane.html.php +++ b/core/views/quick_pane.html.php @@ -1,17 +1,22 @@ type == "photo"): ?> +
id/ccw?csrf=" . access::csrf_token()) ?>">
+ + + +
id/cw?csrf=" . access::csrf_token()) ?>"> @@ -19,3 +24,4 @@
+ -- cgit v1.2.3