function theme_views_editablefields_view_table in Editable Fields 5
Same name and namespace in other branches
- 5.3 editablefields.module \theme_views_editablefields_view_table()
- 5.2 editablefields.module \theme_views_editablefields_view_table()
Display the nodes of a view as a table.
File
- ./
editablefields.module, line 294
Code
function theme_views_editablefields_view_table($view, $nodes, $type) {
$fields = _views_get_fields();
$editable = _handle_editablefield_form_input($view, $nodes);
foreach ($nodes as $node) {
$row = array();
foreach ($view->field as $field) {
if ($fields[$field['id']]['visible'] !== FALSE) {
$cell['data'] = views_theme_field('views_editablefields_handle_field', $field['queryname'], $fields, $field, $node, $view);
$cell['class'] = "view-field " . views_css_safe('view-field-' . $field['queryname']);
$row[] = $cell;
}
}
$rows[] = $row;
}
$html = theme('table', $view->table_header, $rows);
if ($editable) {
$form['editablefields']['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
$form['editablefields']['#value'] = $html;
drupal_process_form('editablefields', $form);
$newentry_form = _editablefields_entry_form($view);
return drupal_render($form) . $newentry_form;
}
else {
return $html;
}
}