function imageinfo_cache_admin_settings_form

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)
cle7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)
elmsmedia7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)
icor7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)
meedjum_blog7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)
mooc7 imageinfo_cache.admin.inc imageinfo_cache_admin_settings_form($form, $form_state)

Form builder; Configure advagg settings.

See also

system_settings_form()

Related topics

1 string reference to 'imageinfo_cache_admin_settings_form'
imageinfo_cache_menu in sites/all/modules/ulmus/imageinfo_cache/imageinfo_cache.module
Implements hook_menu().

File

sites/all/modules/ulmus/imageinfo_cache/imageinfo_cache.admin.inc, line 14
Admin page callbacks for the imageinfo cache module.

Code

function imageinfo_cache_admin_settings_form($form, $form_state) {
  drupal_set_title(t('Imageinfo Cache Configuration'));
  module_load_include('inc', 'imageinfo_cache', 'imageinfo_cache');
  $form = array();

  $form['imageinfo_cache_use_httprl'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use HTTPRL for background image generation'),
    '#default_value' => module_exists('httprl') ? variable_get('imageinfo_cache_use_httprl', IMAGEINFO_CACHE_USE_HTTPRL) : FALSE,
    '#description' => t('If <a href="@link">HTTPRL</a> is installed, image styles will be generated in a background parallel process, thus not slowing down entity saves and image file uploads.', array('@link' => 'http://drupal.org/project/httprl')),
    '#disabled' => module_exists('httprl') ? FALSE : TRUE,
  );

  $form['pre_generation'] = array(
    '#type' => 'fieldset',
    '#title' => t('Pre Generation of Image Styles'),
    '#description' => t('Styles that end with * are enabled by default as they are being used for that field.'),
  );

  // Get image styles.
  $image_styles = array_keys(image_styles());
  $image_styles = array_combine($image_styles, $image_styles);
  ksort($image_styles);

  // Get image fields.
  $image_field_defaults = imageinfo_cache_get_image_fields(FALSE);
  $image_fields = imageinfo_cache_get_image_fields();
  $all_image_styles_used = array();
  foreach ($image_fields as $field_name => $image_styles_used) {
    if (isset($image_styles_used['#field_info'])) {
      unset($image_styles_used['#field_info']);
    }
    $image_styles_used = array_keys($image_styles_used);

    // Create the fieldset.
    $form['pre_generation']['field_' . $field_name] = array(
      '#type' => 'fieldset',
      '#title' => t('@field_name: @styles_checked', array(
        '@field_name' => strpos($field_name, 'field_') === 0 ? substr($field_name, 6) : $field_name,
        '@styles_checked' => implode(', ', $image_styles_used),
      )),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );

    // Add a * to the end of default styles.
    if (isset($image_field_defaults[$field_name]['#field_info'])) {
      unset($image_field_defaults[$field_name]['#field_info']);
    }
    $temp_image_styles = array();
    foreach ($image_styles as $key => $style_name) {
      if (!empty($image_field_defaults[$field_name][$style_name])) {
        $style_name .= '*';
      }
      $temp_image_styles[$key] = $style_name;
    }

    // Create the checkboxes field.
    $form['pre_generation']['field_' . $field_name]['imageinfo_cache_' . $field_name] = array(
      '#type' => 'checkboxes',
      '#options' => $temp_image_styles,
      '#default_value' => $image_styles_used,
    );
    $all_image_styles_used = array_merge($all_image_styles_used, $image_styles_used);
  }
  $all_image_styles_used = array_values(array_unique($all_image_styles_used));
  $all_image_styles_used = array_combine($all_image_styles_used, $all_image_styles_used);
  ksort($all_image_styles_used);
  $styles_not_used = array_diff($image_styles, $all_image_styles_used);

  $form['pre_generation']['styles_not_in_use'] = array(
    '#type' => 'textfield',
    '#title' => 'Image Styles Not in Use',
    '#value' => implode(', ', $styles_not_used),
  );

  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );

  // Clear the cache bins on submit.
  $form['#submit'][] = 'imageinfo_cache_admin_settings_form_submit';

  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  // By default, render the form using theme_system_settings_form().
  $form['#theme'] = 'system_settings_form';
  return $form;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.