function tablefield_required_cell_is_required in TableField 8.2
Helper function to check if a cell is required.
1 call to tablefield_required_cell_is_required()
- tablefield_required_process_tablefield in tablefield_required/
tablefield_required.module - Helper function to process tablefield widgets.
File
- tablefield_required/
tablefield_required.module, line 154 - Contains module hooks for tablefield_required.
Code
function tablefield_required_cell_is_required($row_index, $col_index, array $settings) {
// If whole row is required.
if (!empty($settings['required_rows']) && in_array($row_index, $settings['required_rows'])) {
$required = TRUE;
}
elseif (!empty($settings['required_cols']) && in_array($col_index, $settings['required_cols'])) {
$required = TRUE;
}
else {
$required = FALSE;
}
return $required;
}