function userpoints_filter_parse_input in User Points 7
Same name and namespace in other branches
- 7.2 userpoints.module \userpoints_filter_parse_input()
Parse input and generate an values array.
Parameters
$form_state: Form state with the submitted values.
$tid: Category id to be used as a default.
Return value
Array of values to be used with userpoints_filter_form().
4 calls to userpoints_filter_parse_input()
- userpoints_admin_points in ./
userpoints.admin.inc - Provides an administrative interface for managing points.
- userpoints_admin_transactions in ./
userpoints.admin.inc - Displays a list of transactions.
- userpoints_list_transactions in ./
userpoints.pages.inc - Displays a detailed transaction report for an individual user.
- userpoints_list_users in ./
userpoints.pages.inc - Lists the users and their point totals by all or by category.
File
- ./
userpoints.module, line 1391
Code
function userpoints_filter_parse_input($form_state, $tid = NULL) {
// Enforce tid if passed in through the URL.
$values = isset($form_state['values']) ? $form_state['values'] : array(
'tid' => NULL,
);
if (!isset($values['tid'])) {
if (isset($_GET['tid'])) {
$values['tid'] = $_GET['tid'];
}
elseif ($tid) {
$values['tid'] = $tid;
}
}
if (isset($values['tid'])) {
// Add tid argument to GET.
$_GET['tid'] = $values['tid'];
}
return $values;
}