You are here

function admin_language_nodeapi in Administration Language 6

Implementation of hook_nodeapi().

File

./admin_language.module, line 116
Makes sure all admin pages are displayed in the preferred language of the administrator.

Code

function admin_language_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'presave':
      if (!user_access('use all enabled languages')) {
        if (variable_get('admin_language_force_default', 0)) {

          // force the use of the default site language
          $default = language_default();
          $node->language = $default->language;
        }
      }
      break;
    case 'insert':
    case 'update':
      if (variable_get('admin_language_force_neutral', 0)) {
        unset($node->language);
      }
      break;
  }
}