You are here

function cacheflush_permission in CacheFlush 7

Same name and namespace in other branches
  1. 7.3 cacheflush.module \cacheflush_permission()
  2. 7.2 cacheflush.module \cacheflush_permission()

Implements hook_permission().

File

./cacheflush.module, line 86
Cacheflush module.

Code

function cacheflush_permission() {
  $item = array();
  $item['cacheflush development'] = array(
    'title' => t('List presets'),
    'description' => t('Access to list presets.'),
  );
  $item['cacheflush development add'] = array(
    'title' => t('Add new preset'),
    'description' => t('Alow to add new preset.'),
  );
  $item['cacheflush development delete'] = array(
    'title' => t('Delete preset'),
    'description' => t('Alow to delete preset.'),
  );
  $item['cacheflush preset'] = array(
    'title' => t('Cacheflusher menu'),
    'description' => t('Access to presets.'),
  );
  $item['cacheflush preset clearall'] = array(
    'title' => t('Clear All'),
    'description' => t('Alow to clear all caches.'),
  );
  $cache_presets = variable_get('cacheflush_preset_list', array());
  if ($cache_presets) {
    foreach ($cache_presets as $key => $value) {
      $item["cacheflush preset {$key}"] = array(
        'title' => t("Preset @name", array(
          '@name' => $value['#name'],
        )),
        'description' => t("Alow to clear caches for @name preset.", array(
          '@name' => $value['#name'],
        )),
      );
    }
  }
  return $item;
}