| Versions | |
|---|---|
| 4.7 – 6 | profile_admin_overview() |
| 7 | profile_admin_overview($form) |
Menu callback; display a listing of all editable profile fields.
modules/
<?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;
}
?>