function editor_note_confirm_remove_page in Editor Notes 7
Builds confirmation page for removing selected note.
1 string reference to 'editor_note_confirm_remove_page'
- editor_note_menu in ./
editor_note.module - Implements hook_menu().
File
- ./
editor_note.pages.inc, line 222 - Page callbacks defined in hook_menu for the Editor Notes module.
Code
function editor_note_confirm_remove_page($ajax = NULL, $note_id = NULL) {
if ($note_id == NULL) {
return t('Error: selected note doesn\'t exists. Note ID cannot be found.');
}
if ($ajax) {
ctools_include('ajax');
ctools_include('modal');
$form_state = array(
'ajax' => TRUE,
'title' => t('Are you sure you want to delete the note?'),
);
$output = ctools_modal_form_wrapper('editor_note_confirm_remove_form', $form_state);
// If the form has been submitted, there may be additional instructions
// such as dismissing the modal popup.
if (!empty($form_state['ajax_commands'])) {
$output = $form_state['ajax_commands'];
}
// Returns the ajax instructions to the browser via ajax_render().
print ajax_render($output);
drupal_exit();
}
else {
return drupal_get_form('editor_note_confirm_remove_form', $note_id);
}
}