function lingotek_disassociate_nodes in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.bulk_grid.inc \lingotek_disassociate_nodes()
- 7.4 lingotek.bulk_grid.inc \lingotek_disassociate_nodes()
- 7.5 lingotek.bulk_grid.inc \lingotek_disassociate_nodes()
Callback function to disassociate translations for multiple nodes at a time
Node IDs are passed through the $_SESSION variable at $_SESSION['lingotek_disassociate_nodes']
Returns a fully rendered html form
File
- ./
lingotek.bulk_grid.inc, line 1929
Code
function lingotek_disassociate_nodes($entity_type, $entity_ids) {
$second_run = !empty($form_state['executed']);
$entity_ids = !is_array($entity_ids) ? explode(',', $entity_ids) : $entity_ids;
if (count($entity_ids) > 1 && !$second_run) {
drupal_set_message(format_plural(count($entity_ids), 'You will be disassociating translations for one entity.', 'You will be disassociating translations for @count entities'), 'warning');
}
ctools_include('node.pages', 'node', '');
ctools_include('modal');
ctools_include('ajax');
$form_state = array(
'ajax' => TRUE,
'entity_ids' => $entity_ids,
'entity_type' => $entity_type,
);
$output = ctools_modal_form_wrapper('lingotek_entity_disassociate_form', $form_state);
if (!empty($form_state['executed'])) {
// Create ajax command array, dismiss the modal window.
$commands = array();
$commands[] = ctools_modal_command_dismiss();
$commands[] = ctools_ajax_command_reload();
print ajax_render($commands);
drupal_exit();
}
print ajax_render($output);
}