You are here

function i18n_nodeapi in Internationalization 6

Same name and namespace in other branches
  1. 5.3 i18n.module \i18n_nodeapi()
  2. 5 i18n.module \i18n_nodeapi()
  3. 5.2 i18n.module \i18n_nodeapi()

Implementation of hook_nodeapi().

File

./i18n.module, line 180
Internationalization (i18n) module.

Code

function i18n_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  global $language;
  if (variable_get('language_content_type_' . $node->type, 0)) {

    // Set current language for new nodes if option enabled
    if ($op == 'prepare' && empty($node->nid) && empty($node->language) && variable_get('i18n_newnode_current_' . $node->type, 0)) {
      $node->language = $language->language;
    }
  }
}