function heartbeat_ui_admin_menu_map in Heartbeat 7
Implements hook_admin_menu_map() on behalf of Heartbeat module.
File
- modules/
heartbeat_ui/ heartbeat_ui.module, line 86
Code
function heartbeat_ui_admin_menu_map() {
return;
// TODO Fix this again. This requires that streams and templates have urls
// of their own in the menu system, so we can add the fields and display ourself.
$map['admin/structure/heartbeat_ui/list/%heartbeat_message_template/edit'] = array(
'parent' => 'admin/structure/heartbeat_ui/list',
//'hide' => 'admin/structure/heartbeat_ui/list',
'arguments' => array(
array(
'%heartbeat_message_template' => array_keys(heartbeat_templates_names()),
),
),
);
foreach (entity_get_info() as $obj_type => $info) {
foreach ($info['bundles'] as $bundle_name => $bundle_info) {
if (isset($bundle_info['admin'])) {
$arguments = array();
switch ($obj_type) {
case 'heartbeat_activity':
$fields = array();
foreach (field_info_instances($obj_type, $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
$arguments = array(
'%heartbeat_message_template' => array(
$bundle_name,
),
'%field_ui_menu' => $fields,
);
break;
}
if (!empty($arguments)) {
$path = $bundle_info['admin']['path'];
$map["{$path}/fields/%field_ui_menu"]['parent'] = "{$path}/fields";
$map["{$path}/fields/%field_ui_menu"]['arguments'][] = $arguments;
}
}
}
}
return $map;
}