function _unit_to_seconds in Edit Limit 7
Helper function to convert a time unit to seconds
3 calls to _unit_to_seconds()
- edit_limit_comment_access in ./
edit_limit.module - Access check function to see if the user can still edit the comment or not. It must, at minimum, perform the comment module's access checks first.
- edit_limit_node_view_alter in ./
edit_limit.module - _edit_limit_user_acccess in ./
edit_limit.module - Helper function to perform additional access checks after node_access() has been checked.
File
- ./
edit_limit.module, line 164 - edit_limit.module Primary module file for Edit Limit. This contains all the hooks needed to run the module.
Code
function _unit_to_seconds($time = 0, $unit = 'seconds') {
switch ($unit) {
case 'minutes':
$time_in_seconds = $time * 60;
break;
case 'hours':
$time_in_seconds = $time * 60 * 60;
break;
case 'days':
$time_in_seconds = $time * 60 * 60 * 24;
break;
default:
$time_in_seconds = $time;
break;
}
return $time_in_seconds;
}