You are here

function content_copy_service_import in Deploy - Content Staging 5

Same name and namespace in other branches
  1. 6 services/content_copy_service/content_copy_service.inc \content_copy_service_import()

Content copy import service callback

1 string reference to 'content_copy_service_import'
content_copy_service_service in services/content_copy_service/content_copy_service.module
Implementation of hook_service()

File

services/content_copy_service/content_copy_service.module, line 57

Code

function content_copy_service_import($type_name, $export) {

  // if the type does not already exist, then we assume that
  // we are creating a new content type
  if (!array_key_exists($type_name, content_copy_types())) {
    $type_name = '<create>';
  }
  $values = array(
    'type_name' => $type_name,
    'macro' => $export,
    'op' => 'Submit',
  );
  drupal_execute('content_copy_import_form', $values);
  if ($errors = form_get_errors()) {
    foreach ($errors as $error) {
      $msg .= "{$error} ";
    }
    return services_error("Content Copy Import Error: {$msg}");
    watchdog('deploy', $msg);
  }
  else {
    watchdog("services", "Content Copy Import Service run.");
  }
  return TRUE;
}