diff options
Diffstat (limited to 'modules/profile')
-rw-r--r-- | modules/profile/profile.admin.inc | 24 | ||||
-rw-r--r-- | modules/profile/profile.js | 2 | ||||
-rw-r--r-- | modules/profile/profile.module | 14 | ||||
-rw-r--r-- | modules/profile/profile.pages.inc | 4 |
4 files changed, 22 insertions, 22 deletions
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 4268c01a6..488666ed7 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -8,13 +8,13 @@ /** * Form builder to display a listing of all editable profile fields. - * + * * @ingroup forms * @see profile_admin_overview_submit(). */ function profile_admin_overview(&$form_state = NULL) { $result = db_query('SELECT title, name, type, category, fid, weight FROM {profile_fields} ORDER BY category, weight'); - + $form = array(); $categories = array(); while ($field = db_fetch_object($result)) { @@ -30,15 +30,15 @@ function profile_admin_overview(&$form_state = NULL) { $form[$field->fid]['edit'] = array('#value' => l(t('edit'), "admin/user/profile/edit/$field->fid")); $form[$field->fid]['delete'] = array('#value' => l(t('delete'), "admin/user/profile/delete/$field->fid")); } - + // Add the cateogory combo boxes $categories = array_unique($categories); - foreach($form as $fid => $field) { - foreach($categories as $cat => $category) { + foreach ($form as $fid => $field) { + foreach ($categories as $cat => $category) { $form[$fid]['category']['#options'][$category] = $category; } } - + // Display the submit button only when there's more than one field if (count($form) > 1) { $form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); @@ -51,7 +51,7 @@ function profile_admin_overview(&$form_state = NULL) { } } $form['#tree'] = TRUE; - + $addnewfields = '<h2>'. t('Add new field') .'</h2>'; $addnewfields .= '<ul>'; foreach (_profile_field_types() as $key => $value) { @@ -65,7 +65,7 @@ function profile_admin_overview(&$form_state = NULL) { /** * Submit hanlder to update changed profile field weights and categories. - * + * * @see profile_admin_overview(). */ function profile_admin_overview_submit($form, &$form_state) { @@ -113,7 +113,7 @@ function theme_profile_admin_overview($form) { $category_field['#attributes']['class'] = 'profile-category profile-category-'. $category_number; $rows[] = array(array('data' => $category, 'colspan' => 7, 'class' => 'category')); $rows[] = array('data' => array(array('data' => '<em>'. t('No fields in this category. If this category remains empty when saved, it will be removed.') .'</em>', 'colspan' => 7)), 'class' => 'category-'. $category_number .'-message category-message category-populated'); - + // Make it dragable only if there is more than one field if (isset($form['submit'])) { drupal_add_tabledrag('profile-fields', 'order', 'sibling', 'profile-weight', 'profile-weight-'. $category_number); @@ -125,7 +125,7 @@ function theme_profile_admin_overview($form) { // Add special drag and drop classes that group fields together. $field['weight']['#attributes']['class'] = 'profile-weight profile-weight-'. $categories[$category]; $field['category']['#attributes']['class'] = 'profile-category profile-category-'. $categories[$category]; - + // Add the row $row = array(); $row[] = drupal_render($field['title']); @@ -143,7 +143,7 @@ function theme_profile_admin_overview($form) { if (empty($rows)) { $rows[] = array(array('data' => t('No fields available.'), 'colspan' => 7)); } - + $header = array(t('Title'), t('Name'), t('Type')); if (isset($form['submit'])) { $header[] = t('Category'); @@ -153,7 +153,7 @@ function theme_profile_admin_overview($form) { $output = theme('table', $header, $rows, array('id' => 'profile-fields')); $output .= drupal_render($form); - + return $output; } diff --git a/modules/profile/profile.js b/modules/profile/profile.js index dadc60a01..2d84d27e0 100644 --- a/modules/profile/profile.js +++ b/modules/profile/profile.js @@ -46,7 +46,7 @@ Drupal.behaviors.profileDrag = function(context) { if (!categoryField.is('.profile-category-'+ categoryNum)) { categoryField.removeClass('profile-category-' + oldcategoryNum).addClass('profile-category-' + categoryNum); weightField.removeClass('profile-weight-' + oldcategoryNum).addClass('profile-weight-' + categoryNum); - + categoryField.val(categoryField[0].options[categoryNum].value); } } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 6e6ce260a..290a371ab 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -136,9 +136,9 @@ function profile_menu() { function profile_block($op = 'list', $delta = 0, $edit = array()) { if ($op == 'list') { - $blocks[0]['info'] = t('Author information'); - $blocks[0]['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; - return $blocks; + $blocks[0]['info'] = t('Author information'); + $blocks[0]['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; + return $blocks; } else if ($op == 'configure' && $delta == 0) { // Compile a list of fields to show @@ -189,9 +189,9 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { } if ($output) { - $block['subject'] = t('About %name', array('%name' => $account->name)); - $block['content'] = $output; - return $block; + $block['subject'] = t('About %name', array('%name' => $account->name)); + $block['content'] = $output; + return $block; } } } @@ -236,7 +236,7 @@ function profile_save_profile(&$edit, &$user, $category, $register = FALSE) { $result = _profile_get_fields($category, $register); while ($field = db_fetch_object($result)) { if (_profile_field_serialize($field->type)) { - $edit[$field->name] = serialize($edit[$field->name]); + $edit[$field->name] = serialize($edit[$field->name]); } db_query("DELETE FROM {profile_values} WHERE fid = %d AND uid = %d", $field->fid, $user->uid); db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", $field->fid, $user->uid, $edit[$field->name]); diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc index cb60b5253..ef1392343 100644 --- a/modules/profile/profile.pages.inc +++ b/modules/profile/profile.pages.inc @@ -23,8 +23,8 @@ function profile_browse() { } // Do not allow browsing of private and hidden fields by non-admins. if (!user_access('administer users') && ($field->visibility == PROFILE_PRIVATE || $field->visibility == PROFILE_HIDDEN)) { - drupal_access_denied(); - return; + drupal_access_denied(); + return; } // Compile a list of fields to show. |