You are here

function cmis_browser_content_delete_confirm in CMIS API 7.2

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

Menu callback -- ask for confirmation of CMIS object deletion

1 string reference to 'cmis_browser_content_delete_confirm'
cmis_browser_menu in cmis_browser/cmis_browser.module
Implementation of hook_menu().

File

cmis_browser/cmis_browser.content_delete.inc, line 7

Code

function cmis_browser_content_delete_confirm($form, &$form_state) {
  module_load_include('api.inc', 'cmis');
  $cmis_objectId = urldecode($_GET['id']);
  $form['cmis_objectId'] = array(
    '#type' => 'value',
    '#value' => $cmis_objectId,
  );
  $form['return_url'] = array(
    '#type' => 'value',
    '#value' => $_GET['return_url'],
  );
  try {
    $repository = cmis_get_repository();
    $cmis_object = cmisapi_getProperties($repository->repositoryId, $cmis_objectId);
  } catch (CMISException $e) {
    cmis_error_handler('cmis_content_delete', $e);
  }
  return confirm_form($form, t('Are you sure you want to delete %name?', array(
    '%name' => $cmis_object->properties['cmis:name'],
  )), $_GET['return_url'], t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}