You are here

protected function EntityShareMediasScaldExport::getExportRteFieldCallback in Entity Share 7

Generate the callback to treat the scald content from the field data.

Return value

callable The callback to treat RTE.

1 call to EntityShareMediasScaldExport::getExportRteFieldCallback()
EntityShareMediasScaldExport::rteManagement in modules/entity_share_medias/modules/entity_share_medias_scald/includes/entity_share_medias_scald.export.inc
Alter RTE datas.

File

modules/entity_share_medias/modules/entity_share_medias_scald/includes/entity_share_medias_scald.export.inc, line 82
Class for handling scald Medias Export.

Class

EntityShareMediasScaldExport
Class for scald atoms export.

Code

protected function getExportRteFieldCallback() {
  $instance = $this;
  return function ($matches, &$field_value) use ($instance) {
    foreach ($matches as $match) {
      $full_pattern_match = $match[0];
      $sid = $match[1];
      $context = $match[2];
      $infos = $match[3];

      // Replace sid per file uuid (alter the original field_value,
      // be careful with all references).
      $field_value = str_replace($full_pattern_match, $instance
        ->generateExportRteMediaString($sid, $context, $infos), $field_value);
    }
  };
}