function admin_get_default_blocks in Admin 6.2
Same name and namespace in other branches
- 7.2 admin.module \admin_get_default_blocks()
Get all blocks that have declared themselves visible in the admin toolbar by default.
4 calls to admin_get_default_blocks()
- admin_get_settings in ./
admin.module - Get variable settings or fallback to defaults.
- admin_settings_form in ./
admin.admin.inc - System settings form for admin toolbar.
- admin_update_6202 in ./
admin.install - Update 6202: Update the format of the admin_toolbar variable.
- theme_admin_settings_form in ./
admin.admin.inc - Theme function for the admin settings form.
File
- ./
admin.module, line 345
Code
function admin_get_default_blocks($reset = FALSE) {
static $defaults;
if (!isset($defaults) || $reset) {
$cache = cache_get('admin_default_blocks');
if ($cache && !$reset) {
$defaults = $cache->data;
}
else {
$defaults = array();
foreach (module_implements('block') as $module) {
$module_blocks = module_invoke($module, 'block', 'list');
if ($module_blocks) {
foreach ($module_blocks as $delta => $info) {
if (isset($info['admin'])) {
$defaults["{$module}-{$delta}"] = isset($info['cache']) ? $info['cache'] : BLOCK_NO_CACHE;
}
}
}
}
cache_set('admin_default_blocks', $defaults);
}
}
return $defaults;
}