diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index fde1bcc..b6978a6 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1841,38 +1841,33 @@ function system_image_toolkit_settings($form, &$form_state) { // If we have available toolkits allow the user to select the image toolkit to // use and load the settings forms. - if (count($toolkits_available)) { - $options = array(); - foreach($toolkits_available as $id => $definition) { - $options[$id] = $definition['title']; - } - - $form['image_toolkit'] = array( - '#type' => 'radios', - '#title' => t('Select an image processing toolkit'), - '#default_value' => $current_toolkit, - '#options' => $options, - ); + $options = array(); + foreach($toolkits_available as $id => $definition) { + $options[$id] = $definition['title']; + } - // Get the toolkit settings forms. - foreach ($toolkits_available as $id => $definition) { - $toolkit = $manager->createInstance($id); - $form['image_toolkit_settings'][$id] = array( - '#type' => 'fieldset', - '#title' => t('@toolkit settings', array('@toolkit' => $definition['title'])), - '#collapsible' => TRUE, - '#collapsed' => ($id == $current_toolkit) ? FALSE : TRUE, - '#tree' => TRUE, - ); - $form['image_toolkit_settings'][$id] += $toolkit->settingsForm(); - } + $form['image_toolkit'] = array( + '#type' => 'radios', + '#title' => t('Select an image processing toolkit'), + '#default_value' => $current_toolkit, + '#options' => $options, + ); - $form = system_config_form($form, $form_state); - } - else { - form_set_error('image_toolkit', t('There are no image toolkits available. Drupal comes with support for PHP\'s GD image toolkit. This requires that the GD module for PHP be installed and configured properly. For more information see PHP\'s image documentation.', array('@url' => 'http://php.net/image'))); + // Get the toolkit settings forms. + foreach ($toolkits_available as $id => $definition) { + $toolkit = $manager->createInstance($id); + $form['image_toolkit_settings'][$id] = array( + '#type' => 'fieldset', + '#title' => t('@toolkit settings', array('@toolkit' => $definition['title'])), + '#collapsible' => TRUE, + '#collapsed' => ($id == $current_toolkit) ? FALSE : TRUE, + '#tree' => TRUE, + ); + $form['image_toolkit_settings'][$id] += $toolkit->settingsForm(); } + $form = system_config_form($form, $form_state); + return $form; }