You are here

function _royalsliderfield_process in RoyalSlider Integration 7

Prepares the image and HTML content.

Other fields needs no additional processes.

See also

royalsliderfield_field_presave()

1 call to _royalsliderfield_process()
royalsliderfield_field_presave in contrib/royalsliderfield/royalsliderfield.module
Implements hook_field_presave().

File

contrib/royalsliderfield/royalsliderfield.module, line 223
RoyalSlider Field module.

Code

function _royalsliderfield_process(&$item, $delta, $field, $entity) {
  $item['format'] = $item['rs_content']['format'];
  $item['rs_content'] = $item['rs_content']['value'];
  if (!empty($item['rs_image'])) {
    $file = file_load($item['rs_image']);
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);
    file_usage_add($file, 'royalsliderfield', 'royalsliderfield', $item['rs_image']);
  }
}