function theme_autologout_render_table in Automated Logout 7.4
Same name and namespace in other branches
- 6.4 autologout.module \theme_autologout_render_table()
Custom themeing function, to display roles as a table with checkboxes and textfields for logout threshold.
1 theme call to theme_autologout_render_table()
- autologout_settings in ./
autologout.admin.inc - Settings form for menu callback
File
- ./
autologout.module, line 205 - Used to automagically log out a user after a preset time.
Code
function theme_autologout_render_table($variables) {
$output = "";
if ($variables) {
$element = $variables['element'];
}
$header = array(
'enable' => t('Enable'),
'name' => t('Role Name'),
'timeout' => t('Timeout (seconds)'),
);
$rows = array();
foreach (user_roles(TRUE) as $key => $role) {
$rows[] = array(
'enable' => drupal_render($element['autologout_roles']['autologout_role_' . $key]),
'name' => t($role),
'timeout' => drupal_render($element['autologout_roles']['autologout_role_' . $key . '_timeout']),
);
}
$table = theme('table', array(
'header' => $header,
'rows' => $rows,
));
$output = $table;
return $output;
}