function lingotek_entity_delete_translations_form in Lingotek Translation 7.7
Form constructor for the translations delete.
File
- ./
lingotek.bulk_grid.inc, line 3052
Code
function lingotek_entity_delete_translations_form($form, &$form_state, $nids = array(), $collapse_fieldset = TRUE) {
if (isset($form_state['entity_ids'])) {
$entity_ids = $form_state['entity_ids'];
$collapse_fieldset = FALSE;
}
$form = array();
if (!is_array($entity_ids)) {
$entity_ids = array(
$entity_ids,
);
}
$entity_type = $form_state['entity_type'];
$content_details_string = "<br/>" . $entity_type . ' ' . t("entity ids") . ': ' . implode(", ", $entity_ids) . "<br/>";
$content_delete_message = t('Are you sure you want to delete these translations?' . '<br/>');
$form['confirm'] = array(
'#type' => 'fieldset',
'#prefix' => format_plural(count($entity_ids), '', '<div class="messages warning">' . t('This action will apply to @count entities.') . '</div>'),
'#title' => filter_xss($content_delete_message, array(
'br',
)),
'#description' => filter_xss($content_details_string, array(
'br',
)),
'#suffix' => '<i>' . t("Note: this action cannot be undone.") . '</i>',
'#collapsible' => $collapse_fieldset,
'#collapsed' => $collapse_fieldset,
);
$submit_function = 'lingotek_entity_delete_translations_form_submit';
$form['confirm']['submit'] = array(
'#type' => 'submit',
'#value' => t('Delete Translations'),
'#submit' => array(
$submit_function,
),
);
$form['entity_ids'] = array(
'#type' => 'hidden',
'#value' => json_encode($entity_ids),
);
return $form;
}