You are here

function opigno_quiz_app_views_data in Opigno Quiz App 7

Implements hook_views_data().

File

./opigno_quiz_app.module, line 568
Module file. Defines module hooks.

Code

function opigno_quiz_app_views_data() {
  $data['opigno_quiz_app_quiz_sort']['table']['group'] = t("Opigno Quiz App");
  $data['opigno_quiz_app_quiz_sort']['table']['join'] = array(
    'node' => array(
      'left_field' => 'nid',
      'field' => 'quiz_nid',
    ),
  );
  $data['opigno_quiz_app_quiz_sort']['gid'] = array(
    'title' => t("The Quiz group"),
    'help' => t("The gid of the quiz weight table"),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'relationship' => array(
      'base' => 'node',
      'base field' => 'nid',
      'field' => 'gid',
      'handler' => 'views_handler_relationship',
      'label' => t("Group"),
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
  );
  $data['opigno_quiz_app_quiz_sort']['quiz_nid'] = array(
    'title' => t("The Quiz weight (as in order) inside a group"),
    'relationship' => array(
      'base' => 'node',
      'base field' => 'nid',
      'label' => t("Quiz"),
    ),
  );
  $data['opigno_quiz_app_quiz_sort']['weight'] = array(
    'title' => t("Quiz weight (as in order)"),
    'help' => t("The weight of the quiz inside a specific group"),
    'field' => array(
      'handler' => 'opigno_quiz_app_field_course_quiz_weight',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'opigno_quiz_app_field_course_quiz_weight',
    ),
    'sort' => array(
      'handler' => 'opigno_quiz_app_sort_course_quiz_weight',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
  );
  $data['opigno_quiz_app_quiz_sort']['course_class_progress'] = array(
    'title' => t("Progression"),
    'help' => t('Show the course or class progression for the logged user'),
    'field' => array(
      'handler' => 'opigno_quiz_app_field_course_class_progress',
    ),
  );
  return $data;
}