You are here

function cacheflush_predefined_presets in CacheFlush 7

Same name and namespace in other branches
  1. 7.2 cacheflush.install \cacheflush_predefined_presets()

Creating predefined presets.

1 call to cacheflush_predefined_presets()
cacheflush_install in ./cacheflush.install
Implements hook_install().

File

./cacheflush.install, line 140
Install, update, and uninstall functions for the cacheflush module.

Code

function cacheflush_predefined_presets() {
  $predefined_presets = array(
    '1' => array(
      '#name' => 'Class registry',
      '#editable' => FALSE,
      '#enabled' => TRUE,
      '#cacheflush_preset_values' => array(
        'predefined_class_registry' => array(
          'is_table' => FALSE,
          'functions' => array(
            '0' => 'registry_rebuild',
          ),
        ),
      ),
    ),
    '2' => array(
      '#name' => 'CSS and JavaScript',
      '#editable' => FALSE,
      '#enabled' => TRUE,
      '#cacheflush_preset_values' => array(
        'predefined_css_and_js' => array(
          'is_table' => FALSE,
          'functions' => array(
            '0' => '_drupal_flush_css_js',
            '1' => 'drupal_clear_css_cache',
            '2' => 'drupal_clear_js_cache',
            '3' => 'cache_clear_all',
          ),
        ),
      ),
    ),
    '3' => array(
      '#name' => 'Menu',
      '#editable' => FALSE,
      '#enabled' => TRUE,
      '#cacheflush_preset_values' => array(
        'predefined_css_and_js' => array(
          'is_table' => FALSE,
          'functions' => array(
            '0' => 'node_types_rebuild',
            '1' => 'menu_rebuild',
          ),
        ),
      ),
    ),
    '4' => array(
      '#name' => 'Theme registry',
      '#editable' => FALSE,
      '#enabled' => TRUE,
      '#cacheflush_preset_values' => array(
        'predefined_css_and_js' => array(
          'is_table' => FALSE,
          'functions' => array(
            '0' => 'system_rebuild_theme_data',
            '1' => 'drupal_theme_rebuild',
          ),
        ),
      ),
    ),
  );
  variable_set('cacheflush_preset_list', $predefined_presets);
}