You are here

function radioactivity_admin_profile_list in Radioactivity 6

Same name and namespace in other branches
  1. 5 radioactivity.module \radioactivity_admin_profile_list()
1 string reference to 'radioactivity_admin_profile_list'
radioactivity_menu in ./radioactivity.module

File

./radioactivity-admin-ui.inc, line 61
Radioactivity core admin UI.

Code

function radioactivity_admin_profile_list() {
  $form = array();
  $decay_profiles = radioactivity_get_decay_profiles();
  $profile_rows = array();
  if (count($decay_profiles)) {
    foreach ($decay_profiles as $dpid => $decay_profile) {
      $profile_rows[] = array(
        'data' => array(
          $dpid,
          check_plain($decay_profile["label"]),
          '<a href="' . url('admin/settings/radioactivity/edit_profile/' . $dpid) . '">' . t("Edit") . '</a>',
        ),
      );
    }
  }
  else {
    $profile_rows[] = array(
      'data' => array(
        array(
          'data' => t('No profiles defined'),
          'colspan' => 3,
        ),
      ),
    );
  }
  $profiles_table = theme('table', array(
    t('Id'),
    t('Label'),
    t('Actions'),
  ), $profile_rows);
  $form['profiles_table'] = array(
    '#value' => $profiles_table,
  );
  return $form;
}