function fc_matrix_field_is_complete in Field Complete 7
Simply use the matrix 'empty' hook to see if each entry has content
2 string references to 'fc_matrix_field_is_complete'
- matrix_custom.inc in plugins/
fields/ matrix_custom.inc - matrix_text.inc in plugins/
fields/ matrix_text.inc
File
- plugins/
fields/ matrix.inc, line 10 - Field Complete - Provides field-based completeness for any entity - matrix field plugin.
Code
function fc_matrix_field_is_complete($items, $instance, $field, &$matrix = array()) {
$module = $field['module'];
$zero_as_empty = !empty($instance['settings']['fc']['fc_check_zero']);
foreach ($items as $delta => $item) {
if ($zero_as_empty && (string) $item['value'] === '0') {
$item['value'] = FALSE;
}
$matrix[$item['row'] - 1][$item['col'] - 1] = !module_invoke($module, 'field_is_empty', $item, $field);
}
}