You are here

function quiz_views_handler_field_result_id in Quiz 5.2

Handler for result_id field allowing it to optionally show as the result_id with a link, the result_id with no link or just a link to the result.

Ideally, there should be some way to theme the word Results

1 string reference to 'quiz_views_handler_field_result_id'
quiz_views_tables in ./quiz_views.module
Implementation of hook_views_tables().

File

./quiz_views.module, line 371
This include file implements views 5.x-1.x functionality on behalf of quiz.module

Code

function quiz_views_handler_field_result_id($fieldinfo, $fielddata, $value, $data) {
  switch ($fielddata['options']) {
    case 'nolink':
      return check_plain($value);
    case 'onlylink':
      return l(t('Results'), "user/quiz/{$value}/userresults");
    case 'link':
      return l($value, "user/quiz/{$value}/userresults");
    case 'adminview':
      return l(t('view'), "admin/quiz/{$value}/view");
    case 'actions':
      return l(t('view'), "admin/quiz/{$value}/view") . ' | ' . l(t('delete'), "admin/quiz/{$value}/delete");
    case 'admindelete':
      return l(t('delete'), "admin/quiz/{$value}/delete");
  }
}