I want to display a form having checkboxes against every user role
I have this
$roles = user_roles($membersonly = FALSE, $permission = NULL);
$form['trc_user_roles'] = array(
'#type' => 'chekboxes',
'#title' => 'Allow users who can see uploaded files',
'#options' => $roles,
'#descripion' => 'User roles checked are able to see site-wide uploads.'
);
return system_settings_form($form);
The output is a blank page.
You have a syntax error in your call to
user_roles()and a spelling error (‘chekboxes’). Try this:I’ve also added a
#default_valueattribute so the next time you re-load the form the selected options will be pre-filled in.