You are here

function simple_access_profile_list in Simple Access 6.2

Same name and namespace in other branches
  1. 5.2 simple_access.module \simple_access_profile_list()
  2. 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.admin.inc, line 127
House all the admin functions in inc to make the foot print a lot smaller.

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;
}