function field_tools_field_page in Field tools 7
Same name and namespace in other branches
- 8 field_tools.admin.inc \field_tools_field_page()
Page callback to list all instances of a field with links to edit them.
1 string reference to 'field_tools_field_page'
- field_tools_menu in ./
field_tools.module - Implements hook_menu().
File
- ./
field_tools.admin.inc, line 1307 - Contains admin callbacks for the Field tools module.
Code
function field_tools_field_page($field_name) {
$field = field_info_field($field_name);
if (!$field) {
return t('No field found.');
}
//dsm($field);
$field_instance_list = field_tools_info_instances($field_name);
$bundles = field_info_bundles();
$items = array();
foreach ($field_instance_list as $entity_type => $bundle_list) {
foreach ($bundle_list as $bundle) {
$admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
$items[] = l($bundles[$entity_type][$bundle]['label'], $admin_path . '/fields/' . $field_name);
}
}
return theme('item_list', array(
'items' => $items,
));
}