You are here

function swftools_form_system_performance_settings_alter in SWF Tools 6.3

Implementation of hook_form_FORM_ID_alter().

Alters the system_performance_settings form so the SWF Tools cache can be managed along with other caches.

File

./swftools.module, line 2038
The primary component of SWF Tools that enables comprehensive media handling.

Code

function swftools_form_system_performance_settings_alter(&$form, &$form_state) {
  $form['swftools_cache'] = array(
    '#type' => 'fieldset',
    '#title' => t('SWF Tools cache'),
    '#description' => t('Enabling the SWF Tools cache can offer a performance increase for all users by preventing embedding markup and playlists from being reconstructed on each page load. If the page cache is also enabled, performance increases from enabling the SWF Tools cache will mainly benefit authenticated users.'),
  );
  $form['swftools_cache']['swftools_cache'] = array(
    '#type' => 'radios',
    '#title' => t('SWF Tools cache'),
    '#default_value' => variable_get('swftools_cache', CACHE_NORMAL),
    '#options' => array(
      CACHE_DISABLED => t('Disabled'),
      CACHE_NORMAL => t('Enabled (recommended)'),
    ),
    '#description' => t('During site development it can be helpful to disable the cache and force content to be regenerated on every page call. Note that content being generated via an input filter is always cached by the input filter itself and disabling the SWF Tools cache will not stop the filter cache. Even when the SWF Tools cache is disabled it will continue to store content to allow features such as serving content from %path to function.', array(
      '%path' => base_path() . 'swftools/html/nn',
    )),
  );

  // We want to slot our new section above 'clear cached data' but we can't use weights
  // We use a trick and unset and reset the elements we want lower
  $temp = $form['clear_cache'];
  unset($form['clear_cache']);
  $form['clear_cache'] = $temp;
  $temp = $form['buttons'];
  unset($form['buttons']);
  $form['buttons'] = $temp;
}