You are here

function boost_system_settings_form in Boost 5

Performs alterations to the system settings form before it is rendered.

Called from hook_form_alter().

1 call to boost_system_settings_form()
boost_form_alter in ./boost.module
Implementation of hook_form_alter(). Performs alterations before a form is rendered.

File

./boost.admin.inc, line 16
All the code for the Boost module's administrative interface.

Code

function boost_system_settings_form($form = array()) {
  $form['cache'] = array(
    '#type' => 'hidden',
    '#value' => CACHE_DISABLED,
  );
  $form['boost'] = array(
    '#type' => 'radios',
    '#title' => t('Static page cache'),
    '#default_value' => variable_get('boost', CACHE_DISABLED),
    '#options' => array(
      CACHE_DISABLED => t('Disabled'),
      CACHE_ENABLED => t('Enabled'),
    ),
    '#description' => t('Static page caching is a mechanism which stores dynamically generated web pages as HTML files in a special cache directory located under the Drupal installation directory. By caching a web page in this manner, the web server can serve it out in the fastest possible manner, without invoking PHP or Drupal at all. While this does provide a significant performance and scalability boost, you should note that it could have negative usability side-effects unless your site is targeted at an audience consisting mostly of "anonymous" visitors.'),
  );
  $lifetime =& $form['cache_lifetime'];
  $lifetime['#description'] = t('On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.');
  unset($form['cache_lifetime']);
  $form['cache_lifetime'] =& $lifetime;
  $form['boost_file_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Cache file path'),
    '#default_value' => BOOST_FILE_PATH,
    '#size' => 60,
    '#maxlength' => 255,
    '#required' => TRUE,
    '#description' => t('A file system path where the cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named \'cache\' under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.'),
  );
  return $form;
}