$field) {
$field['data_path'] = empty($field['data_path']) ? '' : $field['data_path'];
if (!isset($field['requirement']) || $field['requirement']) {
if (empty($field['element'])) {
$valueField = $this->element('/genericElements/IndexTable/Fields/generic_field', array('field' => $field, 'row' => $row, 'data_path' => empty($field['data_path']) ? '' : $field['data_path'], 'k' => $k, 'column' => $column));
} else {
$valueField = $this->element(
'/genericElements/IndexTable/Fields/' . $field['element'],
array(
'field' => $field,
'row' => $row,
'column' => $column,
'data_path' => empty($field['data_path']) ? '' : $field['data_path'],
'k' => $k,
'primary' => $primary,
'tableRandomValue' => $tableRandomValue,
'stateDependence' => isset($field['stateDependence']) ? $field['stateDependence'] : []
)
);
}
$rowHtml .= sprintf(
'
%s | ',
(empty($field['id'])) ? '' : sprintf('id="%s"', $field['id']),
(empty($field['class'])) ? '' : sprintf(' class="%s"', $field['class']),
(empty($field['style'])) ? '' : sprintf(' style="%s"', $field['style']),
(empty($field['title'])) ? '' : sprintf(' title="%s"', $field['title']),
(empty($field['name'])) ? '' : sprintf(
' data-path="%s"',
is_array($field['data_path']) ?
h(implode(', ', $field['data_path'])) :
(h($field['data_path']))
),
sprintf(
' data-columnname="%s"',
h(\Cake\Utility\Inflector::variable(!empty($field['name']) ? $field['name'] : \Cake\Utility\Inflector::humanize($field['data_path'])))
),
(empty($field['encode_raw_value']) || empty($field['data_path'])) ? '' : sprintf(' data-value="%s"', (h($this->Hash->extract($row, $field['data_path'])[0]))),
(empty($field['ondblclick'])) ? '' : sprintf(' ondblclick="%s"', $field['ondblclick']),
$valueField
);
}
}
if (!empty($actions)) {
$rowHtml .= $this->element(
'/genericElements/IndexTable/Fields/actions',
array(
'actions' => $actions,
'row' => $row,
'column' => $column,
'primary' => $primary,
'tableRandomValue' => $tableRandomValue
)
);
}
echo ($rowHtml);
?>