function simple_access_profile_list in Simple Access 5.2
Same name and namespace in other branches
- 6.2 simple_access.admin.inc \simple_access_profile_list()
- 7.2 simple_access.admin.inc \simple_access_profile_list()
1 string reference to 'simple_access_profile_list'
- simple_access_menu in ./
simple_access.module - Implementation of hook_menu().
File
- ./
simple_access.module, line 577 - This module allows administrators to make nodes viewable by specific 'access groups'. Each access group can contain any number of roles. If a node is not assigned to any access groups, it will remain viewable by all users.
Code
function simple_access_profile_list() {
$form = array();
$result = db_query('SELECT * FROM {simple_access_profiles} ORDER BY weight ASC, name ASC');
$form['profiles'] = array(
'#tree' => TRUE,
);
while ($row = db_fetch_array($result)) {
$form['profiles'][$row['pid']]['name'] = array(
'#value' => $row['name'],
);
$form['profiles'][$row['pid']]['weight'] = array(
'#type' => 'weight',
'#default_value' => $row['weight'],
'#attributes' => array(
'class' => 'sa-profile-weight',
),
);
$form['profiles'][$row['pid']]['operations'] = array(
'#value' => l(t('edit'), 'admin/user/sa_profiles/' . $row['pid'] . '/edit') . ' ' . l(t('delete'), 'admin/user/sa_profiles/' . $row['pid'] . '/delete'),
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Update'),
);
return $form;
}