profile_admin_overview

  1. drupal
    1. 4.7
    2. 5 profile.module
    3. 6 profile.admin.inc
    4. 7 profile.admin.inc
Versions
4.7 – 6 profile_admin_overview()
7 profile_admin_overview($form)

Menu callback; display a listing of all editable profile fields.

Code

modules/profile.module, line 371

<?php
function profile_admin_overview() {

  $result = db_query('SELECT * FROM {profile_fields} ORDER BY category, weight');
  $rows = array();
  while ($field = db_fetch_object($result)) {
    $rows[] = array(check_plain($field->title), check_plain($field->name), _profile_field_types($field->type), $field->category, l(t('edit'), "admin/settings/profile/edit/$field->fid"), l(t('delete'), "admin/settings/profile/delete/$field->fid"));
  }
  if (count($rows) == 0) {
    $rows[] = array(array(
        'data' => t('No fields defined.'),
        'colspan' => '6',
      ));
  }

  $header = array(t('Title'), t('Name'), t('Type'), t('Category'), array(
      'data' => t('Operations'),
      'colspan' => '2',
    ));

  $output  = theme('table', $header, $rows);
  $output .= '<h2>' . t('Add new field') . '</h2>';
  $output .= '<ul>';
  foreach (_profile_field_types() as $key => $value) {
    $output .= '<li>' . l($value, "admin/settings/profile/add/$key") . '</li>';
  }
  $output .= '</ul>';

  return $output;
}
?>