function quiz_translate_form_date in Quiz 7.5
Same name and namespace in other branches
- 8.4 quiz_datetime.inc \quiz_translate_form_date()
- 5.2 quiz_datetime.inc \quiz_translate_form_date()
- 5 quiz_datetime.inc \quiz_translate_form_date()
- 6.6 quiz_datetime.inc \quiz_translate_form_date()
- 6.2 quiz_datetime.inc \quiz_translate_form_date()
- 6.3 quiz_datetime.inc \quiz_translate_form_date()
- 6.4 quiz_datetime.inc \quiz_translate_form_date()
- 6.5 quiz_datetime.inc \quiz_translate_form_date()
- 7.6 quiz.module \quiz_translate_form_date()
- 7 quiz_datetime.inc \quiz_translate_form_date()
- 7.4 quiz_datetime.inc \quiz_translate_form_date()
Handles the start and end times in a node form submission.
Parameters
$node: The submitted node with form data.
$date: The name of the date ('quiz_open' or 'quiz_close') to translate.
1 call to quiz_translate_form_date()
- _quiz_common_presave_actions in ./
quiz.module - Common actions that need to be done before a quiz is inserted or updated.
File
- ./
quiz.module, line 3873 - quiz.module Main file for the Quiz module.
Code
function quiz_translate_form_date(&$node, $date) {
$human = $node->{$date};
if (!is_numeric($human)) {
$timestamp = strtotime($human);
$node->{$date} = $timestamp;
}
}