You are here

function l10n_client_form in Localization client 6

Same name and namespace in other branches
  1. 5 l10n_client.module \l10n_client_form()
  2. 6.2 l10n_client.module \l10n_client_form()
  3. 7 l10n_client.module \l10n_client_form()

String editing form. Source & selection moved to UI components outside the form. Backed with jquery magic on the client.

@todo This form has nothing to do with different plural versions yet.

2 string references to 'l10n_client_form'
l10n_client_footer in ./l10n_client.module
Implementation of hook_footer().
l10n_client_save_string in ./l10n_client.module
Menu callback. Saves a string translation coming as POST data.

File

./l10n_client.module, line 375
Localization client. Provides on-page translation editing.

Code

function l10n_client_form($form_id, $strings) {
  global $language;

  // Selector and editing form.
  $form = array();
  $form['#action'] = url('l10n_client/save');
  $form['target'] = array(
    '#type' => 'textarea',
    '#resizable' => false,
    '#rows' => 6,
    '#attributes' => array(
      'class' => 'translation-target',
    ),
  );
  $form['save'] = array(
    '#value' => t('Save translation'),
    '#type' => 'submit',
  );

  // Hidden field for textgroup
  $form['textgroup'] = array(
    '#type' => 'hidden',
    '#value' => 'default',
  );
  $form['copy'] = array(
    '#type' => 'button',
    '#id' => 'l10n-client-edit-copy',
    '#attributes' => array(
      'class' => 'form-submit edit-copy',
    ),
    '#value' => t('Copy source'),
  );
  $form['clear'] = array(
    '#type' => 'button',
    '#id' => 'l10n-client-edit-clear',
    '#attributes' => array(
      'class' => 'form-submit edit-clear',
    ),
    '#value' => t('Clear'),
  );
  return $form;
}