Hi all,

Is there a way to hide translation fieldset (that one that contains "This translation is published" and "flag translation as outdated" checkboxes, and "created by" and "modified on" input fields) on field translation page?

I want my users can translates some fields (that's why I give them "Translate entities of type Node" permission), but not manage the above kind of options.

Thank you very much for any help

Comments

plach’s picture

Status: Active » Fixed

They are governed by the same permission, I am afraid. You need to form alter the entity form and set the fieldset '#access' key to FALSE.

mxt’s picture

Thank you for your answer Plach, but using hook_form_alter I can't find "translation" fieldset in the array.

Doing a dpm($form) I can find all the other fieldset (author, revision information, publishing options, comment settings) but there is no trace for "translation" fieldset.

Surely I'm missing something: first of all, I'm using the right hook or does another "entity" hook exists?

plach’s picture

Also ET acts on hook_form_alter(), maybe it's a problem of invocation order since you should find a 'translation' key:

http://drupalcode.org/project/entity_translation.git/blob/refs/heads/7.x-1.x:/includes/translation.handler.inc#l1030

mxt’s picture

Ok I've got it.

For anyone interested in:

Seems that this hook have to be executed after i18n hook.

So, is necessary to change your custom module weight > 10 in system table.

After that, you can implement() hook_form_alter() in this way for example:

/**
 * Implements hook_form_alter().
 */
function yourCustomModule_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'yourID_node_form':
      $form['translation']['#access'] = FALSE;
      break;
  }

Obviously the above code hides translation fieldset for all users. You have to put a condition by user role to restrict or bypass hiding.

@Platch: in any case, may a more granularity in entity translation permissions give rise to a new feature request? I think this can be useful to many: think at "community websites" where common users can translate their own content, but obviously they don't need (and must not have!) the possibility to change the translation author (that is always themselves because they don't share their translations) or to mark their own translations as outdated.

Thank you!

plach’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.