From d19606b96ba0f5ed56e9e736b8fe88210528577c Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 11 Jul 2009 00:58:19 +0000 Subject: I will probably regret this - opening up imagemagick command line to all --- views/default/tidypics/forms/admin.php | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'views/default/tidypics/forms') diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php index a80fff91d..0ade3d885 100644 --- a/views/default/tidypics/forms/admin.php +++ b/views/default/tidypics/forms/admin.php @@ -12,29 +12,37 @@ $action = $vars['url'] . 'action/tidypics/settings'; $plugin = find_plugin_settings('tidypics'); + + + if (extension_loaded('imagick')) + $img_lib_options['ImageMagickPHP'] = 'ImageMagick'; + + $disablefunc = explode(',', ini_get('disable_functions')); + if (is_callable('exec') && !in_array('exec',$disablefunc)) + $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline'; + + $img_lib_options['GD'] = 'GD'; - // Image Library - need to update values! + // Image Library $image_lib = $plugin->image_lib; if (!$image_lib) $image_lib = 'GD'; $form_body = '

' . elgg_echo('tidypics:settings:image_lib'); $form_body .= elgg_view('input/pulldown', array( 'internalname' => 'params[image_lib]', - 'options_values' => array( - 'GD' => 'GD', - 'ImageMagickPHP' => 'ImageMagick', -/* 'ImageMagick' => 'ImageMagick Cmdline', */ - ), + 'options_values' => $img_lib_options, 'value' => $image_lib )); - $form_body .= '

'; -/* - // Image Magick Path - $im_path = $plugin->im_path; - if(!$im_path) $im_path = "/usr/bin/"; - $form_body .= "

" . elgg_echo('tidypics:settings:im_path') . "
"; - $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "

"; -*/ + $form_body .= '
Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.

'; + + if (is_callable('exec') && !in_array('exec',$disablefunc)) { + // Image Magick Path + $im_path = $plugin->im_path; + if(!$im_path) $im_path = "/usr/bin/"; + $form_body .= "

" . elgg_echo('tidypics:settings:im_path') . "
"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "

"; + } + // Tagging $tagging = $plugin->tagging; if(!$tagging) $tagging = "enabled"; -- cgit v1.2.3