function menu_block_menu_tree_content_type_admin_info in Menu Block 7.2
Same name and namespace in other branches
- 6.2 plugins/content_types/menu_tree/menu_tree.inc \menu_block_menu_tree_content_type_admin_info()
- 7.3 plugins/content_types/menu_tree/menu_tree.inc \menu_block_menu_tree_content_type_admin_info()
Callback to provide administrative info (the preview in panels when building a panel).
File
- plugins/
content_types/ menu_tree/ menu_tree.inc, line 158 - Provides ctools integration for "Menu block" trees.
Code
function menu_block_menu_tree_content_type_admin_info($subtype, $conf, $context = NULL) {
// Ensure the delta is unique.
$ids =& drupal_static(__FUNCTION__, array());
if (empty($ids[$conf['menu_name']])) {
$ids[$conf['menu_name']] = 0;
}
$delta = ++$ids[$conf['menu_name']];
$conf['delta'] = 'ctools-' . $conf['menu_name'] . '-' . $delta;
// Force the title to not be a link.
$conf['title_link'] = 0;
$tree = menu_tree_build($conf);
$block = new stdClass();
$block->subtype = $conf['menu_name'];
$block->title = $tree['subject'];
$block->content = $tree['content'];
return $block;
}