You are here

function theme_views_send_token_help in Views Send 6

Same name and namespace in other branches
  1. 7 views_send.module \theme_views_send_token_help()

Theme the replacement tokens.

Parameters

$tokens:: Keyed array with tokens as keys and description as values.

Return value

A themed table wirh all tokens.

1 theme call to theme_views_send_token_help()
views_send_mail_action_form in ./views_send.module
Configuration form for views_send_mail action.

File

./views_send.module, line 928
The Views Send module.

Code

function theme_views_send_token_help($fields) {
  if (!module_exists('token')) {
    $headers = array(
      t('Token'),
      t('Replacement value'),
    );
    $rows = array();
    $rows[] = array(
      array(
        'data' => t('View row tokens'),
        'class' => 'region',
        'colspan' => 2,
      ),
    );
    foreach ($fields as $field => $title) {
      $rows[] = array(
        VIEWS_SEND_TOKEN_PREFIX . sprintf(VIEWS_SEND_TOKEN_PATTERN, $field) . VIEWS_SEND_TOKEN_POSTFIX,
        $title,
      );
    }
    $output = theme('table', $headers, $rows, array(
      'class' => 'description',
    ));
  }
  else {
    $output = theme('token_tree', 'all');
  }
  return $output;
}