You are here

function theme_matomo_admin_custom_var_table in Matomo Analytics 7.2

Layout for the custom variables table in the admin settings form.

Parameters

array $variables: An array contains the form elements.

Return value

string The rendered output.

1 theme call to theme_matomo_admin_custom_var_table()
matomo_admin_settings_form in ./matomo.admin.inc
Implements hook_admin_settings() for configuring the module.

File

./matomo.admin.inc, line 508
Administrative page callbacks for the matomo module.

Code

function theme_matomo_admin_custom_var_table($variables) {
  $form = $variables['form'];
  $header = array(
    array(
      'data' => t('Slot'),
    ),
    array(
      'data' => t('Name'),
    ),
    array(
      'data' => t('Value'),
    ),
    array(
      'data' => t('Scope'),
    ),
  );
  $rows = array();
  foreach (element_children($form['slots']) as $key => $id) {
    $rows[] = array(
      'data' => array(
        drupal_render($form['slots'][$id]['slot']),
        drupal_render($form['slots'][$id]['name']),
        drupal_render($form['slots'][$id]['value']),
        drupal_render($form['slots'][$id]['scope']),
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render($form['matomo_custom_var_description']);
  $output .= drupal_render($form['matomo_custom_var_token_tree']);
  return $output;
}