function theme_views_editablefields_view_list in Editable Fields 5
Same name and namespace in other branches
- 5.3 editablefields.module \theme_views_editablefields_view_list()
- 5.2 editablefields.module \theme_views_editablefields_view_list()
Display the nodes of a view as a list.
File
- ./
editablefields.module, line 260
Code
function theme_views_editablefields_view_list($view, $nodes, $type) {
$fields = _views_get_fields();
$editable = _handle_editablefield_form_input($view, $nodes);
foreach ($nodes as $node) {
$item = '';
foreach ($view->field as $field) {
if (!isset($fields[$field['id']]['visible']) && $fields[$field['id']]['visible'] !== FALSE) {
if ($field['label']) {
$item .= "<div class='view-label " . views_css_safe('view-label-' . $field['queryname']) . "'>" . $field['label'] . "</div>";
}
$item .= "<div class='view-field " . views_css_safe('view-data-' . $field['queryname']) . "'>" . views_theme_field('views_editablefields_handle_field', $field['queryname'], $fields, $field, $node, $view) . "</div>";
}
}
$items[] = "<div class='view-item " . views_css_safe('view-item-' . $view->name) . "'>{$item}</div>\n";
// l($node->title, "node/$node->nid");
}
if ($items) {
$html = theme('item_list', $items);
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;
}
}
}