You are here

function stringoverrides_textbox_combo in String Overrides 6

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

Function to return a textbox combo form

2 calls to stringoverrides_textbox_combo()
stringoverrides_admin in ./stringoverrides.admin.inc
Menu callback for the String Overrides module to display its administration
stringoverrides_js in ./stringoverrides.admin.inc
Menu callback for the String Overrides module to display a new string override

File

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

Code

function stringoverrides_textbox_combo($delta = 0, $enabled = TRUE, $original = '', $replacement = '') {
  $form = array(
    '#tree' => TRUE,
  );
  $form['enabled'] = array(
    '#type' => 'checkbox',
    '#default_value' => $enabled == -1 ? TRUE : $enabled,
    '#parents' => array(
      'string',
      $delta,
      'enabled',
    ),
    '#access' => $enabled != -1,
  );
  $form['original'] = array(
    '#type' => 'textarea',
    '#default_value' => $original,
    '#rows' => 1,
    '#parents' => array(
      'string',
      $delta,
      'original',
    ),
  );
  $form['replacement'] = array(
    '#type' => 'textarea',
    '#default_value' => $replacement,
    '#rows' => 1,
    '#parents' => array(
      'string',
      $delta,
      'replacement',
    ),
  );
  return $form;
}