function lingotek_clear_exceptions_form_submit in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.5 lingotek.module \lingotek_clear_exceptions_form_submit()
File
- ./
lingotek.module, line 2583
Code
function lingotek_clear_exceptions_form_submit($form_state, $form) {
$content_type = $form_state['bundle_name']['#value'];
$delete_keys = "'allow_community_translation', 'create_lingotek_document', 'sync_method', 'url_alias_translation', 'profile'";
$delete_query = db_query("DELETE lem.* FROM {node} AS n JOIN lingotek_entity_metadata AS lem ON n.nid = lem.entity_id WHERE entity_key IN (" . $delete_keys . ") AND type = '" . $content_type . "'");
$delete_query
->execute();
drupal_set_message(t('All translation profile exceptions for nodes of type "@content_type" have been removed.', array(
'@content_type' => $content_type,
)));
}