You are here

function rb_misc_action_variable_get_form in Rules Bonus Pack 6

Configuration form for 'rb_misc_action_variable_get'.

File

./rb_misc.module, line 348
Miscellaneous conditions and actions for Rules.

Code

function rb_misc_action_variable_get_form($settings, &$form) {

  // Get a list of all defined system variables, formatted as a select array.
  global $conf;
  $selectable_variables = array();
  foreach ($conf as $variable => $value) {
    if (is_string($value) || is_integer($value) || is_bool($variable)) {
      $selectable_variables[$variable] = $variable;
    }
  }
  $form['settings']['variable'] = array(
    '#type' => 'select',
    '#options' => $selectable_variables,
    '#default_value' => $settings['variable'],
    '#title' => t('System variable'),
    '#description' => t('Select the system variable you want to load. Note that
      only string, number and boolean variables are available.'),
  );
}