summaryrefslogtreecommitdiff
path: root/modules/profile
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-31 19:01:03 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-31 19:01:03 +0000
commitd4228535043619ada5192001acde645238660b37 (patch)
tree1c4b55878b06e58bd88239e1ceaa598c429beb63 /modules/profile
parent9f44fd1b86fdcc412a0ce7b2d3d2048e8564a979 (diff)
downloadbrdo-d4228535043619ada5192001acde645238660b37.tar.gz
brdo-d4228535043619ada5192001acde645238660b37.tar.bz2
- Patch #536570 by Gábor Hojtsy: implemented new IA for top-level users.
Diffstat (limited to 'modules/profile')
-rw-r--r--modules/profile/profile.admin.inc20
-rw-r--r--modules/profile/profile.module14
-rw-r--r--modules/profile/profile.test6
3 files changed, 20 insertions, 20 deletions
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc
index bf1627f4f..394f42cb1 100644
--- a/modules/profile/profile.admin.inc
+++ b/modules/profile/profile.admin.inc
@@ -27,8 +27,8 @@ function profile_admin_overview() {
$form[$field->fid]['type'] = array('#markup' => $field->type);
$form[$field->fid]['category'] = array('#type' => 'select', '#default_value' => $field->category, '#options' => array());
$form[$field->fid]['weight'] = array('#type' => 'weight', '#default_value' => $field->weight);
- $form[$field->fid]['edit'] = array('#markup' => l(t('edit'), "admin/user/profile/edit/$field->fid"));
- $form[$field->fid]['delete'] = array('#markup' => l(t('delete'), "admin/user/profile/delete/$field->fid"));
+ $form[$field->fid]['edit'] = array('#markup' => l(t('edit'), "admin/settings/profile/edit/$field->fid"));
+ $form[$field->fid]['delete'] = array('#markup' => l(t('delete'), "admin/settings/profile/delete/$field->fid"));
}
// Add the category combo boxes
@@ -55,7 +55,7 @@ function profile_admin_overview() {
$addnewfields = '<h2>' . t('Add new field') . '</h2>';
$addnewfields .= '<ul>';
foreach (_profile_field_types() as $key => $value) {
- $addnewfields .= '<li>' . l($value, "admin/user/profile/add/$key") . '</li>';
+ $addnewfields .= '<li>' . l($value, "admin/settings/profile/add/$key") . '</li>';
}
$addnewfields .= '</ul>';
$form['addnewfields'] = array('#markup' => $addnewfields);
@@ -219,7 +219,7 @@ function profile_field_form(&$form_state, $arg = NULL) {
$form['fields']['category'] = array('#type' => 'textfield',
'#title' => t('Category'),
'#default_value' => $edit['category'],
- '#autocomplete_path' => 'admin/user/profile/autocomplete',
+ '#autocomplete_path' => 'admin/settings/profile/autocomplete',
'#description' => t('The category the new field should be part of. Categories are used to group fields logically. An example category is "Personal information".'),
'#required' => TRUE,
);
@@ -361,7 +361,7 @@ function profile_field_form_submit($form, &$form_state) {
->fields($values)
->execute();
drupal_set_message(t('The field has been created.'));
- watchdog('profile', 'Profile field %field added under category %category.', array('%field' => $form_state['values']['title'], '%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/user/profile'));
+ watchdog('profile', 'Profile field %field added under category %category.', array('%field' => $form_state['values']['title'], '%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/settings/profile'));
}
else {
db_update('profile_field')
@@ -373,7 +373,7 @@ function profile_field_form_submit($form, &$form_state) {
cache_clear_all();
menu_rebuild();
- $form_state['redirect'] = 'admin/user/profile';
+ $form_state['redirect'] = 'admin/settings/profile';
return;
}
@@ -390,8 +390,8 @@ function profile_field_delete(&$form_state, $fid) {
$form['title'] = array('#type' => 'value', '#value' => $field->title);
return confirm_form($form,
- t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/user/profile',
- t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/' . $fid))),
+ t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/settings/profile',
+ t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/settings/profile/edit/' . $fid))),
t('Delete'), t('Cancel'));
}
@@ -409,9 +409,9 @@ function profile_field_delete_submit($form, &$form_state) {
cache_clear_all();
drupal_set_message(t('The field %field has been deleted.', array('%field' => $form_state['values']['title'])));
- watchdog('profile', 'Profile field %field deleted.', array('%field' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/user/profile'));
+ watchdog('profile', 'Profile field %field deleted.', array('%field' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/settings/profile'));
- $form_state['redirect'] = 'admin/user/profile';
+ $form_state['redirect'] = 'admin/settings/profile';
return;
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index bc3ecd6b6..4d85e4c76 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -43,7 +43,7 @@ function profile_help($path, $arg) {
$output .= '<li>' . t('date') . '</li></ul>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@profile">Profile module</a>.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) . '</p>';
return $output;
- case 'admin/user/profile':
+ case 'admin/settings/profile':
return '<p>' . t("This page displays a list of the existing custom profile fields to be displayed on a user's <em>My Account</em> page. To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") . '</p>';
}
}
@@ -82,34 +82,34 @@ function profile_menu() {
'access arguments' => array('access user profiles'),
'type' => MENU_SUGGESTED_ITEM,
);
- $items['admin/user/profile'] = array(
+ $items['admin/settings/profile'] = array(
'title' => 'Profiles',
'description' => 'Create customizable fields for your users.',
'page callback' => 'drupal_get_form',
'page arguments' => array('profile_admin_overview'),
'access arguments' => array('administer users'),
);
- $items['admin/user/profile/add'] = array(
+ $items['admin/settings/profile/add'] = array(
'title' => 'Add field',
'page callback' => 'drupal_get_form',
'page arguments' => array('profile_field_form'),
'access arguments' => array('administer users'),
'type' => MENU_CALLBACK,
);
- $items['admin/user/profile/autocomplete'] = array(
+ $items['admin/settings/profile/autocomplete'] = array(
'title' => 'Profile category autocomplete',
'page callback' => 'profile_admin_settings_autocomplete',
'access arguments' => array('administer users'),
'type' => MENU_CALLBACK,
);
- $items['admin/user/profile/edit'] = array(
+ $items['admin/settings/profile/edit'] = array(
'title' => 'Edit field',
'page callback' => 'drupal_get_form',
'page arguments' => array('profile_field_form'),
'access arguments' => array('administer users'),
'type' => MENU_CALLBACK,
);
- $items['admin/user/profile/delete'] = array(
+ $items['admin/settings/profile/delete'] = array(
'title' => 'Delete field',
'page callback' => 'drupal_get_form',
'page arguments' => array('profile_field_delete'),
@@ -150,7 +150,7 @@ function profile_block_configure($delta = '') {
'#title' => t('Profile fields to display'),
'#default_value' => variable_get('profile_block_author_fields', array()),
'#options' => $fields,
- '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/user/profile'))),
+ '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/settings/profile'))),
);
return $form;
}
diff --git a/modules/profile/profile.test b/modules/profile/profile.test
index ac6872efa..aaa2f8a9b 100644
--- a/modules/profile/profile.test
+++ b/modules/profile/profile.test
@@ -36,7 +36,7 @@ class ProfileTestCase extends DrupalWebTestCase {
$edit['category'] = $category;
$edit['explanation'] = $this->randomName(50);
- $this->drupalPost('admin/user/profile/add/' . $type, $edit, t('Save field'));
+ $this->drupalPost('admin/settings/profile/add/' . $type, $edit, t('Save field'));
$fid = db_query("SELECT fid FROM {profile_field} WHERE title = :title", array(':title' => $title))->fetchField();
$this->assertTrue($fid, t('New Profile field has been entered in the database'));
@@ -107,8 +107,8 @@ class ProfileTestCase extends DrupalWebTestCase {
* The field to be deleted.
*/
function deleteProfileField($field) {
- $this->drupalPost('admin/user/profile/delete/' . $field['fid'], array(), t('Delete'));
- $this->drupalGet('admin/user/profile');
+ $this->drupalPost('admin/settings/profile/delete/' . $field['fid'], array(), t('Delete'));
+ $this->drupalGet('admin/settings/profile');
$this->assertNoText($field['title'], t('Checking deleted field %title', array('%title' => $field['title'])));
}
}