You are here

function views_ui_add_argument in Views (for Drupal 7) 5

Add all the info for a single argument into the form.

File

./views_ui.module, line 1372

Code

function views_ui_add_argument(&$form, $argument, &$order, $key, $i) {
  $arguments = _views_get_arguments();
  $arg_type = $form['id']['#value'];
  $arginfo = $arguments[$arg_type];
  $form['type'] = array(
    '#type' => 'hidden',
    '#default_value' => $argument['id'],
  );
  $form['name'] = array(
    '#value' => $arginfo['name'],
  );
  $form['argdefault'] = array(
    '#type' => 'select',
    '#default_value' => max(1, intval($argument['argdefault'])),
    '#options' => _views_get_arguments_default(),
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#default_value' => $argument['title'],
    '#size' => 10,
    '#maxlength' => 255,
  );
  if (isset($arginfo['option'])) {
    $form['options'] = views_ui_setup_widget($arginfo['option'], $argument['options']);
  }
  $form['wildcard'] = array(
    '#type' => 'textfield',
    '#default_value' => $argument['wildcard'],
    '#size' => 5,
    '#maxlength' => 32,
  );
  $form['wildcard_substitution'] = array(
    '#type' => 'textfield',
    '#default_value' => $argument['wildcard_substitution'],
    '#size' => 5,
    '#maxlength' => 32,
  );
  if (isset($arginfo['help'])) {
    $form['help'] = array(
      '#type' => 'markup',
      '#value' => $arginfo['help'],
    );
  }
}