You are here

function emfield_reload in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 emfield.admin.inc \emfield_reload()
  2. 6.3 deprecated/emfield-deprecated.admin.inc \emfield_reload()
  3. 6.2 emfield.admin.inc \emfield_reload()

This reloads and saves the data for a single node.

1 string reference to 'emfield_reload'
emfield_settings_jobqueue_submit in ./emfield.admin.inc
For each selected content type, add all of its nodes to the job queue for reloading.

File

./emfield.admin.inc, line 227
The administrative settings page.

Code

function emfield_reload($nid) {
  if ($node = node_load($nid)) {
    $type = content_types($node->type);
    foreach ($type['fields'] as $field) {
      if (module_hook($field['type'], 'emfield_info')) {
        $items = $node->{$field['field_name']};
        emfield_emfield_field('submit', $node, $field, $items, FALSE, FALSE, $field['type']);
        $node->{$field['field_name']} = $items;
        node_save($node);
      }
    }
  }
}