You are here

function cmis_browser_content_delete_confirm_submit in CMIS API 6.2

Same name and namespace in other branches
  1. 6.4 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
  2. 6.3 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
  3. 7.2 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
  4. 7 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()

Execute CMIS object deletion.

File

cmis_browser/cmis_browser.content_delete.inc, line 35

Code

function cmis_browser_content_delete_confirm_submit($form, &$form_state) {
  module_load_include('api.inc', 'cmis');
  if ($form_state['values']['confirm']) {
    $cmis_objectId = $form_state['values']['cmis_objectId'];
    try {
      $repository = cmisapi_getRepositoryInfo();
      $cmis_object = cmisapi_getProperties($repository->repositoryId, $cmis_objectId);
      $content = cmisapi_deleteObject($repository->repositoryId, $cmis_object->id);
      drupal_set_message(t('CMIS object @name has been deleted.', array(
        '@name' => $cmis_object->title,
      )));
    } catch (CMISException $e) {
      cmis_error_handler('cmis_content_delete', $e);
    }
  }
  $form_state['redirect'] = $form_state['values']['return_url'];
}