You are here

function theme_yandex_metrics_reports_reports in Yandex.Metrics 8.3

Same name and namespace in other branches
  1. 7.3 yandex_metrics_reports/yandex_metrics_reports.module \theme_yandex_metrics_reports_reports()

Theme function for the Report setting table.

File

yandex_metrics_reports/yandex_metrics_reports.module, line 428
The main code of Yandex.Metrics Reports module.

Code

function theme_yandex_metrics_reports_reports($vars) {
  $form = $vars['form'];
  $header = array(
    array(
      'data' => t('Report visibility settings'),
      'colspan' => 2,
    ),
  );
  $rows = array();
  foreach (element_children($form['reports']) as $report_name) {
    $row = array(
      drupal_render($form['reports'][$report_name]['yandex_metrics_reports_' . $report_name . '_visible']),
      drupal_render($form['reports'][$report_name]['yandex_metrics_reports_' . $report_name . '_weight']),
    );
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'yandex-metrics-reports-reports-table',
    ),
  ));
  drupal_add_tabledrag('yandex-metrics-reports-reports-table', 'order', 'sibling', 'yandex-metrics-reports-report-weight');
  $output .= drupal_render_children($form);
  return $output;
}