function content_inactive_fields in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 content.module \content_inactive_fields()
Helper function to identify inactive fields.
1 call to content_inactive_fields()
- content_inactive_message in includes/
content.admin.inc - Helper function to display a message about inactive fields.
File
- ./
content.module, line 2663 - Allows administrators to associate custom fields to content types.
Code
function content_inactive_fields($type_name = NULL) {
module_load_include('inc', 'content', 'includes/content.crud');
if (!empty($type_name)) {
$param = array(
'type_name' => $type_name,
);
$inactive = array(
$type_name => array(),
);
}
else {
$param = array();
$inactive = array();
}
$all = content_field_instance_read($param, TRUE);
$active = array_keys(content_fields());
foreach ($all as $field) {
if (!in_array($field['field_name'], $active)) {
$inactive[$field['type_name']][$field['field_name']] = content_field_instance_expand($field);
}
}
if (!empty($type_name)) {
return $inactive[$type_name];
}
return $inactive;
}