function workflow_admin_ui_delete_form in Workflow 7
Same name and namespace in other branches
- 6.2 workflow_admin_ui/workflow_admin_ui.module \workflow_admin_ui_delete_form()
- 6 workflow_admin_ui/workflow_admin_ui.module \workflow_admin_ui_delete_form()
Form builder. Create form for confirmation of workflow deletion.
Parameters
$wid: The workflow object to delete.
Return value
Form definition array.
1 string reference to 'workflow_admin_ui_delete_form'
- workflow_admin_ui_menu in workflow_admin_ui/
workflow_admin_ui.module - Implements hook_menu().
File
- workflow_admin_ui/
workflow_admin_ui.pages.inc, line 90 - Provides administrative UI for workflow. Why it's own module? Lower code footprint and better performance. Additional credit to gcassie ( http://drupal.org/user/80260 ) for the initial push to split UI out of core workflow. We're moving…
Code
function workflow_admin_ui_delete_form($form, &$form_state, $workflow) {
// If we don't have a workflow that goes with this, return to the admin page.
if (!$workflow) {
drupal_goto('admin/config/workflow/workflow');
}
else {
// Let's add some breadcrumbs.
workflow_admin_ui_breadcrumbs($workflow);
$form = array();
$form['workflow'] = array(
'#type' => 'value',
'#value' => $workflow,
);
return confirm_form($form, t('Are you sure you want to delete %title? All nodes and fields that have a workflow state associated with this workflow will ' . 'have those workflow states removed.', array(
'%title' => $workflow
->getName(),
)), !empty($_GET['destination']) ? $_GET['destination'] : 'admin/config/workflow/workflow', t('This action cannot be undone.'), t('Delete ' . $workflow
->getName()), t('Cancel'));
}
}