diff options
-rw-r--r-- | core/helpers/graphics.php | 15 | ||||
-rw-r--r-- | core/views/quick_pane.html.php | 6 |
2 files changed, 21 insertions, 0 deletions
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 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <? if ($item->type == "photo"): ?> +<? if (graphics::can("rotate")): ?> <div class="rotate-counter-clockwise" href="<?= url::site("quick/rotate/$item->id/ccw?csrf=" . access::csrf_token()) ?>"> <span> <?= _("Rotate CCW") ?> </span> </div> +<? endif ?> + <div class="edit gDialogLink" href="<?= url::site("quick/form_edit/$item->id") ?>"> <span> <?= _("Edit") ?> </span> </div> + +<? if (graphics::can("rotate")): ?> <div class="rotate-clockwise" href="<?= url::site("quick/rotate/$item->id/cw?csrf=" . access::csrf_token()) ?>"> <span> @@ -19,3 +24,4 @@ </span> </div> <? endif ?> +<? endif ?> |