diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-04-14 17:48:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-04-14 17:48:46 +0000 |
commit | 56d2664a904119f73e7df4fb355e4c525e040b70 (patch) | |
tree | 0ac2302d485b4b0769d269825880975428bd3b0c /modules/profile | |
parent | 46cda4c6ae388cd2e918ae2aec887e617e5bd44e (diff) | |
download | brdo-56d2664a904119f73e7df4fb355e4c525e040b70.tar.gz brdo-56d2664a904119f73e7df4fb355e4c525e040b70.tar.bz2 |
- Patch #245115 by kkaefer, John Morahan, JohnAlbin et al: after a long discussion we've decided to make the concatenation operator consistent with the other operators.
Diffstat (limited to 'modules/profile')
-rw-r--r-- | modules/profile/profile.admin.inc | 30 | ||||
-rw-r--r-- | modules/profile/profile.module | 42 |
2 files changed, 36 insertions, 36 deletions
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 490b48e91..dd355c47b 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -52,10 +52,10 @@ function profile_admin_overview() { } $form['#tree'] = TRUE; - $addnewfields = '<h2>'. t('Add new field') .'</h2>'; + $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/user/profile/add/$key") . '</li>'; } $addnewfields .= '</ul>'; $form['addnewfields'] = array('#value' => $addnewfields); @@ -91,10 +91,10 @@ function profile_admin_overview_submit($form, &$form_state) { * @see profile_admin_overview() */ function theme_profile_admin_overview($form) { - drupal_add_css(drupal_get_path('module', 'profile') .'/profile.css'); + drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css'); // Add javascript if there's more than one field. if (isset($form['submit'])) { - drupal_add_js(drupal_get_path('module', 'profile') .'/profile.js'); + drupal_add_js(drupal_get_path('module', 'profile') . '/profile.js'); } $rows = array(); @@ -110,21 +110,21 @@ function theme_profile_admin_overview($form) { // Category classes are given numeric IDs because there's no guarantee // class names won't contain invalid characters. $categories[$category] = $category_number; - $category_field['#attributes']['class'] = 'profile-category profile-category-'. $category_number; + $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'); + $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); - drupal_add_tabledrag('profile-fields', 'match', 'sibling', 'profile-category', 'profile-category-'. $category_number); + drupal_add_tabledrag('profile-fields', 'order', 'sibling', 'profile-weight', 'profile-weight-' . $category_number); + drupal_add_tabledrag('profile-fields', 'match', 'sibling', 'profile-category', 'profile-category-' . $category_number); } $category_number++; } // 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]; + $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(); @@ -251,14 +251,14 @@ Unless you know what you are doing, it is highly recommended that you prefix the $form['fields']['page'] = array('#type' => 'textfield', '#title' => t('Page title'), '#default_value' => $edit['page'], - '#description' => t('To enable browsing this field by value, enter a title for the resulting page. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". This is only applicable for a public field.'), + '#description' => t('To enable browsing this field by value, enter a title for the resulting page. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value" . This is only applicable for a public field.'), ); } else if ($type == 'checkbox') { $form['fields']['page'] = array('#type' => 'textfield', '#title' => t('Page title'), '#default_value' => $edit['page'], - '#description' => t('To enable browsing this field by value, enter a title for the resulting page. An example page title is "People who are employed". This is only applicable for a public field.'), + '#description' => t('To enable browsing this field by value, enter a title for the resulting page. An example page title is "People who are employed" . This is only applicable for a public field.'), ); } $form['fields']['weight'] = array('#type' => 'weight', @@ -313,10 +313,10 @@ function profile_field_form_validate($form, &$form_state) { $query_suffix = ' AND fid != %d'; } - if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s' AND category = '%s'". $query_suffix, $args1))) { + if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s' AND category = '%s'" . $query_suffix, $args1))) { form_set_error('title', t('The specified title is already in use.')); } - if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'". $query_suffix, $args2))) { + if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'" . $query_suffix, $args2))) { form_set_error('name', t('The specified name is already in use.')); } if ($form_state['values']['visibility'] == PROFILE_HIDDEN) { @@ -371,7 +371,7 @@ function profile_field_delete(&$form_state, $fid) { 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('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('Delete'), t('Cancel')); } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 6031afbb0..feecd0a79 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -32,19 +32,19 @@ define('PROFILE_HIDDEN', 4); function profile_help($path, $arg) { switch ($path) { case 'admin/help#profile': - $output = '<p>'. t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the <em>My Account</em> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') .'</p>'; - $output .= '<p>'. t('The following types of fields can be added to a user profile:') .'</p>'; - $output .= '<ul><li>'. t('single-line textfield') .'</li>'; - $output .= '<li>'. t('multi-line textfield') .'</li>'; - $output .= '<li>'. t('checkbox') .'</li>'; - $output .= '<li>'. t('list selection') .'</li>'; - $output .= '<li>'. t('freeform list') .'</li>'; - $output .= '<li>'. t('URL') .'</li>'; - $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>'; + $output = '<p>' . t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the <em>My Account</em> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') . '</p>'; + $output .= '<p>' . t('The following types of fields can be added to a user profile:') . '</p>'; + $output .= '<ul><li>' . t('single-line textfield') . '</li>'; + $output .= '<li>' . t('multi-line textfield') . '</li>'; + $output .= '<li>' . t('checkbox') . '</li>'; + $output .= '<li>' . t('list selection') . '</li>'; + $output .= '<li>' . t('freeform list') . '</li>'; + $output .= '<li>' . t('URL') . '</li>'; + $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': - 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>'; + 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>'; } } @@ -183,7 +183,7 @@ function profile_block($op = 'list', $delta = '', $edit = array()) { } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { - $output .= '<div>'. l(t('View full user profile'), 'user/'. $account->uid) .'</div>'; + $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>'; } } @@ -258,11 +258,11 @@ function profile_view_field($user, $field) { return check_markup($value); case 'textfield': case 'selection': - return $browse ? l($value, 'profile/'. $field->name .'/'. $value) : check_plain($value); + return $browse ? l($value, 'profile/' . $field->name . '/' . $value) : check_plain($value); case 'checkbox': - return $browse ? l($field->title, 'profile/'. $field->name) : check_plain($field->title); + return $browse ? l($field->title, 'profile/' . $field->name) : check_plain($field->title); case 'url': - return '<a href="'. check_url($value) .'">'. check_plain($value) .'</a>'; + return '<a href="' . check_url($value) . '">' . check_plain($value) . '</a>'; case 'date': $format = substr(variable_get('date_format_short', 'm/d/Y - H:i'), 0, 5); // Note: Avoid PHP's date() because it does not handle dates before @@ -283,7 +283,7 @@ function profile_view_field($user, $field) { $fields = array(); foreach ($values as $value) { if ($value = trim($value)) { - $fields[] = $browse ? l($value, 'profile/'. $field->name .'/'. $value) : check_plain($value); + $fields[] = $browse ? l($value, 'profile/' . $field->name . '/' . $value) : check_plain($value); } } return implode(', ', $fields); @@ -321,7 +321,7 @@ function profile_view_profile(&$user) { '#title' => $title, '#value' => $value, '#weight' => $field->weight, - '#attributes' => array('class' => 'profile-'. $field->name), + '#attributes' => array('class' => 'profile-' . $field->name), ); } } @@ -331,11 +331,11 @@ function _profile_form_explanation($field) { $output = $field->explanation; if ($field->type == 'list') { - $output .= ' '. t('Put each item on a separate line or separate them by commas. No HTML allowed.'); + $output .= ' ' . t('Put each item on a separate line or separate them by commas. No HTML allowed.'); } if ($field->visibility == PROFILE_PRIVATE) { - $output .= ' '. t('The content of this field is kept private and will not be shown publicly.'); + $output .= ' ' . t('The content of this field is kept private and will not be shown publicly.'); } return $output; @@ -361,7 +361,7 @@ function profile_form_profile($edit, $user, $category, $register = FALSE) { '#required' => $field->required, ); if ($field->autocomplete) { - $fields[$category][$field->name]['#autocomplete_path'] = "profile/autocomplete/". $field->fid; + $fields[$category][$field->name]['#autocomplete_path'] = "profile/autocomplete/" . $field->fid; } break; case 'textarea': @@ -534,7 +534,7 @@ function template_preprocess_profile_wrapper(&$variables) { if ($field = arg(1)) { $variables['current_field'] = $field; // Supply an alternate template suggestion based on the browsable field. - $variables['template_files'][] = 'profile-wrapper-'. $field; + $variables['template_files'][] = 'profile-wrapper-' . $field; } } |