You are here

function lingotek_dev_form in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 6 lingotek.dev.inc \lingotek_dev_form()
  2. 7.7 lingotek.dev.inc \lingotek_dev_form()
  3. 7.2 lingotek.dev.inc \lingotek_dev_form()
  4. 7.3 lingotek.dev.inc \lingotek_dev_form()
  5. 7.4 lingotek.dev.inc \lingotek_dev_form()
  6. 7.6 lingotek.dev.inc \lingotek_dev_form()
1 string reference to 'lingotek_dev_form'
lingotek_dev_page in ./lingotek.dev.inc
@file Developer Utilities

File

./lingotek.dev.inc, line 15
Developer Utilities

Code

function lingotek_dev_form($ignore, $param) {
  $nid = $param['build_info']['args'][0];
  $form['dev'] = array(
    '#type' => 'fieldset',
    '#title' => t('LingoNode'),
    '#description' => t('Modify the contents of a LingoNode'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['dev']['nid'] = array(
    '#type' => 'textfield',
    '#title' => t('nid'),
    '#description' => t('Drupal Node Id'),
    '#default_value' => $nid,
  );
  $form['dev']['key'] = array(
    '#type' => 'textfield',
    '#title' => t('lingokey'),
    '#description' => t('Key for the LingoNode'),
    '#default_value' => '',
  );
  $form['dev']['value'] = array(
    '#type' => 'textfield',
    '#title' => t('lingovalue'),
    '#description' => t('Value for the LingoNode'),
    '#default_value' => '',
  );
  $form['actions']['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Save/Edit'),
    '#weight' => 15,
    '#submit' => array(
      'lingotek_dev_submit',
    ),
  );
  $form['data'] = array(
    '#type' => 'fieldset',
    '#title' => t('Data'),
    '#description' => t('Contents of the LingoNodes'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $header = array(
    'nid',
    t('Key'),
    t('Value'),
  );
  $rows = array();
  if ($nid == '') {
    $rs = lingotek_keystore('node', 'all');
    foreach ($rs as $nid => $entry) {
      foreach ($entry as $key => $value) {
        $row = array(
          $nid,
          $key,
          $value,
        );
        $rows[] = $row;
      }
    }
  }
  else {
    $rs = lingotek_keystore('node', $nid);
    $header = array(
      t('Key'),
      t('Value'),
    );
    foreach ($rs as $key => $value) {
      $row = array(
        $key,
        $value,
      );
      $rows[] = $row;
    }
  }
  $form['data']['value'] = array(
    '#type' => 'item',
    '#markup' => theme('table', array(
      'header' => $header,
      'rows' => $rows,
    )),
  );
  return $form;
}