function _quiz_add_to_get in Quiz 6.4
Same name and namespace in other branches
- 8.4 quiz.admin.inc \_quiz_add_to_get()
- 7 quiz.admin.inc \_quiz_add_to_get()
- 7.4 quiz.admin.inc \_quiz_add_to_get()
Adds variables from a querystring to $_GET
This is to help the pager system work with ajax
Parameters
$to_add: query string
See also
2 calls to _quiz_add_to_get()
- quiz_results_manage_results_form in ./
quiz.admin.inc - Form for searching after and manipulating results for a quiz
- _quiz_question_browser_form in ./
quiz.admin.inc - Creates the browser part of the quiz_questions_form
File
- ./
quiz.admin.inc, line 2521 - Administrator interface for Quiz module.
Code
function _quiz_add_to_get($to_add) {
$pre = 'quiz_question_browser_';
parse_str($to_add, $output);
$vars = array(
'sort',
'order',
'page',
);
if (empty($to_add)) {
unset($_SESSION[$pre . 'page']);
}
foreach ($vars as $value) {
if (isset($output[$value])) {
$_GET[$value] = $_SESSION[$pre . $value] = $output[$value];
}
elseif (isset($_GET[$value])) {
continue;
}
elseif (isset($_SESSION[$pre . $value])) {
$_GET[$value] = $_SESSION[$pre . $value];
}
}
}