You are here

function theme_statspro_log in Statistics Pro 6.2

Same name and namespace in other branches
  1. 6 statspro.reports.inc \theme_statspro_log()
1 theme call to theme_statspro_log()
statspro_overview in ./statspro_overview.inc
Callback function for overview page.

File

./statspro_overview.inc, line 127

Code

function theme_statspro_log($period, $data) {
  $output = '<div id="content-area">';
  if (is_array($data)) {
    if (statspro_get_available_charts_graphs()) {
      $all_users_data = array();
      $all_users_x_labels = array();
      $authenticated_users_data = array();
      $authenticated_users_x_labels = array();
      $odd = TRUE;
      foreach ($data as $serie) {
        if ($odd) {
          $all_users_x_labels[] = strip_tags($serie[0]);
          $all_users_data[] = $serie[1];
        }
        else {
          $authenticated_users_x_labels[] = strip_tags($serie[0]);
          $authenticated_users_data[] = $serie[1];
        }
        $odd = !$odd;
      }
      $all_users_data = array(
        $all_users_data,
      );
      $authenticated_users_data = array(
        $authenticated_users_data,
      );
      $output .= statspro_get_pie_chart(t('All users - !period', array(
        '!period' => $period,
      )), $all_users_data, $all_users_x_labels);
      $output .= "\n<br />\n";
      $output .= statspro_get_pie_chart(t('Authenticated users - !period', array(
        '!period' => $period,
      )), $authenticated_users_data, $authenticated_users_x_labels);
    }

    // theme the table
    $header = array(
      t('Name'),
      t('Value'),
    );
    $output .= theme('table', $header, $data);
  }
  else {
    $output .= t('No access and log files available for specified period.');
  }
  $output .= '</div>';
  return $output;
}