You are here

function l10n_client_form in Localization client 5

Same name and namespace in other branches
  1. 6.2 l10n_client.module \l10n_client_form()
  2. 6 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 253
Localization client. Provides on-page translation editing.

Code

function l10n_client_form($strings) {
  global $language;

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

  // Store location in the form to pass to the ajax save function
  $form['location'] = array(
    '#type' => 'hidden',
    '#value' => request_uri(),
  );

  // Store lid in the form too
  $form['lid'] = array(
    '#type' => 'hidden',
    '#value' => 0,
  );
  $form['copy'] = array(
    '#value' => "<input id='edit-copy' class='form-submit' type='button' value='" . t('Copy Source') . "'/>",
  );
  $form['clear'] = array(
    '#value' => "<input id='edit-clear' class='form-submit' type='button' value='" . t('Clear') . "'/>",
  );
  return $form;
}