Skip to content

Commit

Permalink
Issue #804: move hook_admin_bar_cache_info() into base modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
docwilmot authored and quicksketch committed Sep 9, 2018
1 parent 7871642 commit 83c2fcb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
32 changes: 0 additions & 32 deletions core/modules/admin_bar/admin_bar.inc
Original file line number Diff line number Diff line change
Expand Up @@ -796,38 +796,6 @@ function admin_bar_admin_bar_cache_info() {
return $caches;
}

/**
* Implements hook_admin_bar_cache_info().
*/
function system_admin_bar_cache_info() {
$caches = array(
'assets' => t('CSS and JavaScript'),
'cache' => t('Page and else'),
'layout' => t('Layout'),
'menu' => t('Menu'),
'theme' => t('Theme registry'),
'token' => t('Token registry'),
);
foreach ($caches as $name => $cache) {
$caches[$name] = array(
'title' => $cache,
'callback' => '_admin_bar_flush_cache',
);
}
return $caches;
}

/**
* Implements hook_admin_bar_cache_info() on behalf of Update module.
*/
function update_admin_bar_cache_info() {
$caches['update'] = array(
'title' => t('Update data'),
'callback' => '_update_cache_clear',
);
return $caches;
}

/**
* Flush all caches or a specific one.
*
Expand Down
21 changes: 21 additions & 0 deletions core/modules/system/system.module
Original file line number Diff line number Diff line change
Expand Up @@ -4174,3 +4174,24 @@ function _system_sort_form_values_by_config($form, &$form_state, $inherited_buck
}
return $configs;
}

/**
* Implements hook_admin_bar_cache_info().
*/
function system_admin_bar_cache_info() {
$caches = array(
'assets' => t('CSS and JavaScript'),
'cache' => t('Page and else'),
'layout' => t('Layout'),
'menu' => t('Menu'),
'theme' => t('Theme registry'),
'token' => t('Token registry'),
);
foreach ($caches as $name => $cache) {
$caches[$name] = array(
'title' => $cache,
'callback' => '_admin_bar_flush_cache',
);
}
return $caches;
}
11 changes: 11 additions & 0 deletions core/modules/update/update.module
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,17 @@ function update_flush_caches() {
return array();
}

/**
* Implements hook_admin_bar_cache_info().
*/
function update_admin_bar_cache_info() {
$caches['update'] = array(
'title' => t('Update data'),
'callback' => '_update_cache_clear',
);
return $caches;
}

/**
* Implements hook_config_info().
*/
Expand Down

1 comment on commit 83c2fcb

@backdrop-ci
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.