You are here

function content_copy_service_import in Deploy - Content Staging 6

Same name and namespace in other branches
  1. 5 services/content_copy_service/content_copy_service.module \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.inc, line 10
Link CCK content copy functionality to services module.

Code

function content_copy_service_import($type_name, $export) {
  if (!content_copy_content_type_exists($type_name)) {
    $type_name = '<create>';
  }
  $values = array(
    'type_name' => $type_name,
    'macro' => $export,
    'op' => 'Submit',
  );
  $form_state['values'] = $values;
  drupal_execute('content_copy_import_form', $form_state);
  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;
}