Skip to content

Instantly share code, notes, and snippets.

@kimpepper
Created May 15, 2013 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimpepper/5583144 to your computer and use it in GitHub Desktop.
Save kimpepper/5583144 to your computer and use it in GitHub Desktop.
foreach (drupal_container()->get('plugin.manager.system.plugin_ui')->getDefinitions() as $plugin_id => $plugin) {
list($plugin_base, $key) = explode(':', $plugin_id);
if ($plugin_base == 'block_plugin_ui') {
$theme = $themes[$key];
$items['admin/structure/block/list/' . $plugin_id] = array(
'title' => check_plain($theme->info['name']),
'page arguments' => array($key),
'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'access callback' => '_block_themes_access',
'access arguments' => array($key),
'file' => 'block.admin.inc',
);
$items['admin/structure/block/demo/' . $key] = array(
'title' => check_plain($theme->info['name']),
'page callback' => 'block_admin_demo',
'page arguments' => array($key),
'type' => MENU_CALLBACK,
'access callback' => '_block_themes_access',
'access arguments' => array($key),
'theme callback' => '_block_custom_theme',
'theme arguments' => array($key),
'file' => 'block.admin.inc',
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment