You are here

function _ca_custom_php_variables_table in Ubercart 6.2

Return a fieldset used to display available variables for custom PHP conditions and actions.

2 calls to _ca_custom_php_variables_table()
ca_action_custom_php_form in ca/ca.ca.inc
ca_condition_custom_php_form in ca/ca.ca.inc

File

ca/ca.ca.inc, line 479
This file includes some generic conditions and actions.

Code

function _ca_custom_php_variables_table($arguments) {
  $rows = array();
  $header = array(
    t('Variable'),
    t('Type'),
    t('Description'),
  );

  // Translate the arguments into descriptive rows.
  foreach ($arguments as $key => $value) {
    $rows[] = array(
      check_plain('$' . $key),
      check_plain($value['#entity']),
      $value['#title'],
    );
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No variables available.'),
        'colspan' => 3,
      ),
    );
  }
  $fieldset = array(
    '#type' => 'fieldset',
    '#title' => t('Available PHP variables'),
    '#description' => t('You may use these variables in your custom PHP.') . theme('table', $header, $rows),
    '#collapsible' => TRUE,
  );
  return $fieldset;
}