You are here

function stringoverrides_admin in String Overrides 5

Same name and namespace in other branches
  1. 6 stringoverrides.admin.inc \stringoverrides_admin()
  2. 7 stringoverrides.admin.inc \stringoverrides_admin()

Menu callback for the String Overrides module to display its administration

1 string reference to 'stringoverrides_admin'
stringoverrides_menu in ./stringoverrides.module
Implementation of hook_menu()

File

./stringoverrides.admin.inc, line 11
Admin page callbacks for the String Overrides module.

Code

function stringoverrides_admin() {
  $form = array();
  $form['string'] = array(
    '#theme' => 'stringoverrides_strings',
  );

  // Retrieve the words to display
  $delta = 0;
  $words = variable_get('locale_custom_strings_en', array());
  uksort($words, 'strcasecmp');

  // Case insensitive sort by key
  foreach ($words as $original => $replacement) {
    $form['string'][$delta] = stringoverrides_textbox_combo($delta, TRUE, $original, $replacement);
    $delta++;
  }
  for ($index = 0; $index < 3; $index++) {
    $form['string'][$delta] = stringoverrides_textbox_combo($delta);
    $delta++;
  }
  $form['language'] = array(
    '#type' => 'textfield',
    '#title' => t('Language code'),
    '#description' => t('The language code that appears in the <a href="@dirlang">language information and text direction</a> for the HTML document. Note that this cannot be "en", but something else. "en-US" is appropriate, but feel free to change it.', array(
      '@dirlang' => 'http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html#langcodes',
    )),
    '#default_value' => variable_get('stringoverrides_language', 'en-US'),
    '#required' => TRUE,
  );
  $form['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
    '#weight' => 3,
  );
  return $form;
}