function boost_admin_settings

×

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 boost.admin.inc boost_admin_settings()
cle7 boost.admin.inc boost_admin_settings()
elmsmedia7 boost.admin.inc boost_admin_settings()
icor7 boost.admin.inc boost_admin_settings()
meedjum_blog7 boost.admin.inc boost_admin_settings()
mooc7 boost.admin.inc boost_admin_settings()

Form builder; Configure boost settings.

See also

system_settings_form()

Related topics

1 string reference to 'boost_admin_settings'
boost_menu in sites/all/modules/ulmus/boost/boost.module
Implements hook_menu().

File

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

Code

function boost_admin_settings() {
  drupal_add_js(drupal_get_path('module', 'system') . '/system.js');

  $form['cacheability'] = array(
    '#type' => 'fieldset',
    '#title' => t('Boost cacheability settings'),
  );
  // See http://api.drupal.org/api/function/block_admin_configure/7
  $access = user_access('use PHP for settings');
  $options = array(
    BOOST_VISIBILITY_NOTLISTED => t('All pages except those listed'),
    BOOST_VISIBILITY_LISTED => t('Only the listed pages'),
  );
  $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
  if (module_exists('php') && $access) {
    $options += array(BOOST_VISIBILITY_PHP => t('Pages on which this PHP code returns <code>TRUE</code> (experts only)'));
    $title = t('Pages or PHP code');
    $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', array('%php' => '<?php ?>'));
  }
  else {
    $title = t('Pages');
  }
  $form['cacheability']['boost_cacheability_option'] = array(
    '#type' => 'radios',
    '#title' => t('Cache specific pages'),
    '#options' => $options,
    '#default_value' => variable_get('boost_cacheability_option', BOOST_VISIBILITY_NOTLISTED),
  );
  $form['cacheability']['boost_cacheability_pages'] = array(
    '#type' => 'textarea',
    '#title' => '<span class="element-invisible">' . $title . '</span>',
    '#default_value' => variable_get('boost_cacheability_pages', BOOST_CACHEABILITY_PAGES),
    '#description' => $description,
  );


  $types = boost_get_storage_types();
  $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 64800, 86400, 2 * 86400, 3 * 86400, 4 * 86400, 5 * 86400, 6 * 86400, 604800, 2 * 604800, 3 * 604800, 4 * 604800, 8 * 604800, 16 * 604800, 52 * 604800), 'format_interval');

  $form['cache_types'] = array(
    '#type' => 'fieldset',
    '#title' => t('Boost cache type settings'),
  );
  foreach ($types as $title => $content_types) {
    $form['cache_types'][$title] = array(
      '#type' => 'fieldset',
      '#title' => t('@title settings', array('@title' => $title)),
      '#collapsible' => TRUE,
    );
    $collapsed = TRUE;
    foreach ($content_types as $type => $values) {
      $form['cache_types'][$title][$type] = array(
        '#type' => 'fieldset',
        '#title' => t('@type settings', array('@type' => $type)),
        '#description' => t('Cache @description of type @type', array(
          '@description' => $values['description'],
          '@type' => $type,
        )),
      );
      // This content type enabled?
      $form['cache_types'][$title][$type]['boost_enabled_' . $type] = array(
        '#type' => 'checkbox',
        '#title' => t('Cache Enabled'),
        '#default_value' => $values['enabled'],
      );

      // Content type extension
      $form['cache_types'][$title][$type]['boost_extension_' . $type] = array(
        '#type' => 'textfield',
        '#title' => t('Filename Extension', array(
          '@title' => $title,
          '@description' => $values['description'],
          '@type' => $type,
        )),
        '#default_value' => $values['extension'],
      );

      // Maximum cache lifetime
      $form['cache_types'][$title][$type]['boost_lifetime_max_' . $type] = array(
        '#type' => 'select',
        '#options' => $period,
        '#title' => t('@type - Maximum Cache Lifetime', array(
          '@title' => $title,
          '@description' => $values['description'],
          '@type' => $type,
        )),
        '#default_value' => $values['lifetime_max'],
      );

      // Minimum cache lifetime
      $form['cache_types'][$title][$type]['boost_lifetime_min_' . $type] = array(
        '#type' => 'select',
        '#options' => $period,
        '#title' => t('@type - Minimum Cache Lifetime', array(
          '@title' => $title,
          '@description' => $values['description'],
          '@type' => $type,
        )),
        '#default_value' => $values['lifetime_min'],
      );
      if ($values['enabled']) {
        $collapsed = !$values['enabled'];
      }
    }
    $form['cache_types'][$title]['#collapsed'] = $collapsed;
  }

  // reset htaccess on submit;
  $form['#submit'][] = 'boost_form_submit_handler';
  return system_settings_form($form);
}