You are here

function lingotek_form_alter in Lingotek Translation 6

Same name and namespace in other branches
  1. 8 lingotek.module \lingotek_form_alter()
  2. 8.2 lingotek.module \lingotek_form_alter()
  3. 7.4 lingotek.module \lingotek_form_alter()
  4. 4.0.x lingotek.module \lingotek_form_alter()
  5. 3.0.x lingotek.module \lingotek_form_alter()
  6. 3.1.x lingotek.module \lingotek_form_alter()
  7. 3.2.x lingotek.module \lingotek_form_alter()
  8. 3.3.x lingotek.module \lingotek_form_alter()
  9. 3.4.x lingotek.module \lingotek_form_alter()
  10. 3.5.x lingotek.module \lingotek_form_alter()
  11. 3.6.x lingotek.module \lingotek_form_alter()
  12. 3.7.x lingotek.module \lingotek_form_alter()
  13. 3.8.x lingotek.module \lingotek_form_alter()

File

./lingotek.module, line 98

Code

function lingotek_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['#id']) && strpos($form['#id'], 'node-form') !== FALSE && isset($form['#node']->type)) {
    $nid = $form['#parameters'][2]->nid;

    //Only give options if the node is new
    if (!isset($nid)) {
      $form['lingotek'] = array(
        '#title' => t('Lingotek Settings'),
        '#type' => 'fieldset',
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#description' => t("These settings can only be set once, when creating the page."),
        '#access' => user_access('access content creation added options'),
      );
      $form['lingotek']['phaseTemplate'] = array(
        '#type' => 'select',
        '#title' => t('Phase Template'),
        '#default_value' => variable_get('lingotek_phase_template', ''),
        '#options' => lingotek_get_phase_templates(),
      );
    }
  }
}