--- translation.module 2008-12-10 22:35:06.000000000 +0200 +++ translation-new.module 2008-12-13 14:03:30.000000000 +0200 @@ -76,8 +76,9 @@ * all languages). */ function _translation_tab_access($node) { + global $user; if (!empty($node->language) && translation_supported_type($node->type)) { - return user_access('translate content'); + return user_access('translate content') || ($node->uid == $user->uid && user_access('translate own content')); } return FALSE; } @@ -86,7 +87,7 @@ * Implementation of hook_perm(). */ function translation_perm() { - return array('translate content'); + return array('translate content','translate own content'); } /** @@ -97,6 +98,7 @@ * is about to be created. */ function translation_form_alter(&$form, $form_state, $form_id) { + global $user; if ($form_id == 'node_type_form') { // Add translation option to content type form. $form['workflow']['language_content_type']['#options'][TRANSLATION_ENABLED] = t('Enabled, with translation'); @@ -125,7 +127,7 @@ $form['translation'] = array( '#type' => 'fieldset', '#title' => t('Translation settings'), - '#access' => user_access('translate content'), + '#access' => user_access('translate content') || ($node->uid == $user->uid && user_access('translate own content')), '#collapsible' => TRUE, '#collapsed' => !$node->translate, '#tree' => TRUE, @@ -185,6 +187,7 @@ * Manages translation information for nodes. */ function translation_nodeapi(&$node, $op, $teaser, $page) { + global $user; // Only act if we are dealing with a content type supporting translations. if (!translation_supported_type($node->type)) { return; @@ -194,7 +197,7 @@ case 'prepare': if (empty($node->nid) && isset($_GET['translation']) && isset($_GET['language']) && ($source_nid = $_GET['translation']) && ($language = $_GET['language']) && - (user_access('translate content'))) { + (user_access('translate content') || ($node->uid == $user->uid && user_access('translate own content')) )) { // We are translating a node from a source node, so // load the node to be translated and populate fields. $node->language = $language; @@ -339,3 +342,4 @@ } } } +