function simple_access_page_overview in Simple Access 6.2
Same name and namespace in other branches
- 5.2 simple_access.module \simple_access_page_overview()
- 5 simple_access.module \simple_access_page_overview()
- 7.2 simple_access.admin.inc \simple_access_page_overview()
@file House all the admin functions in inc to make the foot print a lot smaller.
1 string reference to 'simple_access_page_overview'
- simple_access_menu in ./
simple_access.module - Implementation of hook_menu().
File
- ./
simple_access.admin.inc, line 9 - House all the admin functions in inc to make the foot print a lot smaller.
Code
function simple_access_page_overview() {
if (count($groups = simple_access_get_groups())) {
drupal_set_title(t('Access groups'));
$roles = user_roles();
$form['groups'] = array(
'#tree' => TRUE,
);
foreach ($groups as $group) {
$gid = $group['gid'];
$form['groups'][$gid]['name'] = array(
'#value' => $group['name'],
);
$r = array();
foreach ($group['roles'] as $rid) {
$r[] = $roles[$rid];
}
$form['groups'][$gid]['roles'] = array(
'#value' => implode(', ', $r),
);
$form['groups'][$gid]['weight'] = array(
'#type' => 'weight',
'#default_value' => $group['weight'],
'#attributes' => array(
'class' => 'sa-group-weight',
),
);
$form['groups'][$gid]['ops'] = array(
'#value' => l('edit', 'admin/user/simple_access/edit/' . $gid) . ' ' . l('delete', 'admin/user/simple_access/delete/' . $gid),
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Update'),
);
return $form;
}
else {
drupal_set_message(t('You have not yet defined any access groups.'));
drupal_goto('admin/user/simple_access/add');
}
}