You are here

function theme_views_editablefields_view_table_noform in Editable Fields 5.3

Display the nodes of a view as a table.

File

./editablefields.module, line 426

Code

function theme_views_editablefields_view_table_noform($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) {
    if ($nodes) {
      $form['editablefields-d-' . $view->name]['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Update'),
      );
      $form['editablefields-d-' . $view->name]['#value'] = $html;
      drupal_process_form('editablefields-d-' . $view->name, $form);
      $eform = drupal_render($form);
      return $eform;
    }
  }
  return $html;
}