function _views_bulk_operations_fields_action_non_cck in Views Bulk Operations (VBO) 6.3
Same name and namespace in other branches
- 6 actions/fields.action.inc \_views_bulk_operations_fields_action_non_cck()
File
- ./
fields.action.inc, line 240 - Drupal action to set individual field values.
Code
function _views_bulk_operations_fields_action_non_cck($type) {
module_load_include('inc', 'node', 'node.pages');
global $user;
$form_state = array(
'storage' => NULL,
'submitted' => FALSE,
);
$form_id = $type . '_node_form';
$node = array(
'uid' => $user->uid,
'name' => isset($user->name) ? $user->name : '',
'type' => $type,
'language' => '',
);
$form = drupal_retrieve_form($form_id, $form_state, $node);
drupal_prepare_form($form_id, $form, $form_state);
$fields = array();
foreach ($form['#content_extra_fields'] as $field_name => $value) {
if (isset($form[$field_name]) && !in_array($form[$field_name]['#type'], array(
'hidden',
'value',
))) {
$fields[$field_name] = array(
'field_name' => $field_name,
'field_form' => array(
$field_name => $form[$field_name],
),
'widget' => array(
'label' => $value['label'],
),
'multiple' => FALSE,
);
}
}
return $fields;
}