You are here

function opigno_lrs_stats_course_content_page in Opigno TinCan API 7

Display courses statistic page

1 call to opigno_lrs_stats_course_content_page()
opigno_lrs_stats_course_content_general_statistics_form_ajax_submit in modules/opigno_tincan_api_stats/includes/course_content/general_statistics_form.inc
Implements hook_form_submit().
1 string reference to 'opigno_lrs_stats_course_content_page'
opigno_tincan_api_stats_menu in modules/opigno_tincan_api_stats/opigno_tincan_api_stats.module
Implements hook_menu().

File

modules/opigno_tincan_api_stats/includes/course_content/course_content.pages.inc, line 14

Code

function opigno_lrs_stats_course_content_page() {
  $module_path = drupal_get_path('module', 'opigno_tincan_api_stats');
  drupal_add_css("{$module_path}/css/styles.css", 'theme');
  $opigno_lrs = variable_get('opigno_lrs_stats_course_content_general_statistics_form_values');
  switch ($opigno_lrs['display_period']) {
    case OPIGNO_LRS_STATS_CURRENT_WEEK:
      $statement_filter_function = 'opigno_lrs_stats_filter_current_week_statements';
      break;
    case OPIGNO_LRS_STATS_CURRENT_MONTH:
      $statement_filter_function = 'opigno_lrs_stats_filter_current_month_statements';
      break;
    case OPIGNO_LRS_STATS_CURRENT_YEAR:
      $statement_filter_function = 'opigno_lrs_stats_filter_current_year_statements';
      break;
    case OPIGNO_LRS_STATS_FOREVER:
    default:
      $statement_filter_function = NULL;
      break;
  }
  return theme('opigno_lrs_stats_course_content', array(
    'general_statistics' => opigno_lrs_stats_course_content_general_statistics($statement_filter_function),
    'course_contexts_statistics' => opigno_lrs_stats_course_content_course_contexts_statistics($statement_filter_function),
  ));
}