quiz_views_handler_field_question_status.inc in Quiz 6.3
Same filename and directory in other branches
- 8.4 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 6.6 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 6.4 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 6.5 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 7.6 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 7 includes/views/handlers/quiz_views_handler_field_question_status.inc
- 7.4 includes/views/handlers/quiz_views_handler_field_question_status.inc
Views field handler that translates question status integer constants (as defined in quiz.module) into their human-readable string counterparts.
File
includes/views/handlers/quiz_views_handler_field_question_status.incView source
<?php
/**
* @file
* Views field handler that translates question status integer constants (as
* defined in quiz.module) into their human-readable string counterparts.
*/
class quiz_views_handler_field_question_status extends views_handler_field {
var $text_map = array();
function pre_render($values) {
$this->text_map = array(
QUESTION_RANDOM => t('Random'),
// 'Random-ly' better?
QUESTION_ALWAYS => t('Always'),
QUESTION_NEVER => t('Never'),
);
}
function render($values) {
return $this->text_map[$values->{$this->field_alias}];
}
}
Classes
Name | Description |
---|---|
quiz_views_handler_field_question_status | @file Views field handler that translates question status integer constants (as defined in quiz.module) into their human-readable string counterparts. |