function cmis_browser_content_delete_confirm_submit in CMIS API 7
Same name and namespace in other branches
- 6.4 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
- 6.2 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
- 6.3 cmis_browser/cmis_browser.content_delete.inc \cmis_browser_content_delete_confirm_submit()
- 7.2 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 = cmis_get_repository();
$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->properties['cmis:name'],
)));
} catch (CMISException $e) {
cmis_error_handler('cmis_content_delete', $e);
}
}
$form_state['redirect'] = $form_state['values']['return_url'];
}