You are here

function _rules_admin_form_argument in Rules 6

2 calls to _rules_admin_form_argument()
rules_admin_form_add_rule_set in rules_admin/rules_admin.sets.inc
Form for adding a rule set
rules_admin_form_add_rule_set_add_arguments in rules_admin/rules_admin.sets.inc
rules AHAH JS callback for adding arguments

File

rules_admin/rules_admin.sets.inc, line 291

Code

function _rules_admin_form_argument($name = '', $info = array()) {
  $form = array();
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label'),
    '#size' => 40,
    '#default_value' => isset($info['label']) ? $info['label'] : '',
  );
  $options = rules_extract_property(array_filter(rules_get_data_types(), 'rules_admin_element_filter'), 'label');
  $options = array_map('drupal_ucfirst', $options);
  asort($options);
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Data type'),
    '#options' => array(
      0 => '--',
    ) + $options,
    '#default_value' => isset($info['type']) ? $info['type'] : '',
  );
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine readable variable name'),
    '#size' => 40,
    '#default_value' => $name,
  );
  return $form;
}