You are here

function cacheflush_create_tab_options in CacheFlush 7.3

Create option array for preset.

Parameters

array $tabels: Cache tabels.

string $category: Category to add.

Return value

array

1 call to cacheflush_create_tab_options()
_cacheflush_get_option_list in ./cacheflush.module
Return a list of cache options to be cleared.

File

./cacheflush.module, line 206
Cacheflush module.

Code

function cacheflush_create_tab_options(array $tabels, $category) {
  $tables_info = array();
  foreach ($tabels as $table) {
    $schema = drupal_get_schema($table);
    $schema = drupal_get_schema_unprocessed($schema['module']);
    $tables_info[$table] = array(
      'description' => isset($schema[$table]['description']) ? $schema[$table]['description'] : t('No description available'),
      'category' => $category,
      'functions' => array(
        '0' => array(
          '#name' => 'cache_clear_all',
          '#params' => array(
            '*',
            $table,
            TRUE,
          ),
        ),
      ),
    );
  }
  return $tables_info;
}