function autologout_ahah_get_remaining_time in Automated Logout 7.4
Same name and namespace in other branches
- 6.4 autologout.module \autologout_ahah_get_remaining_time()
AJAX callback that returns the time remaining for this user is logged out.
1 string reference to 'autologout_ahah_get_remaining_time'
- autologout_menu in ./
autologout.module - Implements hook_menu().
File
- ./
autologout.module, line 526 - Used to automagically log out a user after a preset time.
Code
function autologout_ahah_get_remaining_time() {
$time_remaining_ms = _autologout_get_remaining_time() * 1000;
// Reset the timer.
$markup = autologout_create_timer();
$commands = array();
$commands[] = ajax_command_replace('#timer', $markup);
$commands[] = ajax_command_settings(array(
'time' => $time_remaining_ms,
));
return array(
'#type' => 'ajax',
'#commands' => $commands,
);
}