Index: modules/profile/profile-block.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile-block.tpl.php,v
retrieving revision 1.4
diff -u -p -r1.4 profile-block.tpl.php
--- modules/profile/profile-block.tpl.php	6 Aug 2009 05:05:59 -0000	1.4
+++ modules/profile/profile-block.tpl.php	13 Aug 2009 09:15:33 -0000
@@ -1,42 +0,0 @@
-<?php
-// $Id: profile-block.tpl.php,v 1.4 2009/08/06 05:05:59 webchick Exp $
-
-/**
- * @file
- * Default theme implementation for displaying a users profile within a
- * block. It only shows in relation to a node displayed as a full page.
- *
- * Available variables:
- * - $user_picture: Image configured for the account linking to the users page.
- * - $profile: Keyed array of all profile fields that have a value.
- *
- * Each $field in $profile contains:
- * - $field->title: Title of the profile field.
- * - $field->value: Value of the profile field.
- * - $field->type: Type of the profile field, i.e., checkbox, textfield,
- *   textarea, selection, list, url or date.
- *
- * Since $profile is keyed, a direct print of the field is possible. Not
- * all accounts may have a value for a profile so do a check first. If a field
- * of "last_name" was set for the site, the following can be used.
- *
- *  <?php if (isset($profile['last_name'])): ?>
- *    <div class="field last-name">
- *      <?php print $profile['last_name']->title; ?>:<br />
- *      <?php print $profile['last_name']->value; ?>
- *    </div>
- *  <?php endif; ?>
- *
- * @see template_preprocess_profile_block()
- */
-?>
-<?php print $user_picture; ?>
-
-<?php foreach ($profile as $field) : ?>
-  <p>
-    <?php if ($field->type != 'checkbox') : ?>
-      <strong><?php print $field->title; ?></strong><br />
-    <?php endif; ?>
-    <?php print $field->value; ?>
-  </p>
-<?php endforeach; ?>
Index: modules/profile/profile-listing.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile-listing.tpl.php,v
retrieving revision 1.7
diff -u -p -r1.7 profile-listing.tpl.php
--- modules/profile/profile-listing.tpl.php	6 Aug 2009 05:05:59 -0000	1.7
+++ modules/profile/profile-listing.tpl.php	13 Aug 2009 09:15:33 -0000
@@ -1,53 +0,0 @@
-<?php
-// $Id: profile-listing.tpl.php,v 1.7 2009/08/06 05:05:59 webchick Exp $
-
-/**
- * @file
- * Default theme implementation for displaying a user and their profile data
- * for member listing pages.
- *
- * @see profile-wrapper.tpl.php
- *      where all the data is collected and printed out.
- *
- * Available variables:
- * - $account: User's account object.
- * - $user_picture: Image configured for the account linking to the users page.
- * - $name: User's account name linking to the users page.
- * - $profile: Keyed array of all profile fields that are set as visible
- *   in member list pages (configured by site administrators). It also needs
- *   to have a value in order to be present.
- *
- * Each $field in $profile contains:
- * - $field->title: Title of the profile field.
- * - $field->value: Value of the profile field.
- * - $field->type: Type of the profile field, i.e., checkbox, textfield,
- *   textarea, selection, list, url or date.
- *
- * Since $profile is keyed, a direct print of the field is possible. Not
- * all accounts may have a value for a profile so do a check first. If a field
- * of "last_name" was set for the site, the following can be used.
- *
- *  <?php if (isset($profile['last_name'])): ?>
- *    <div class="field last-name">
- *      <?php print $profile['last_name']->title; ?>:<br />
- *      <?php print $profile['last_name']->value; ?>
- *    </div>
- *  <?php endif; ?>
- *
- * @see template_preprocess_profile_listing()
- */
-?>
-<div class="profile clearfix">
-  <?php print $user_picture; ?>
-
-  <div class="name">
-    <?php print $name; ?>
-  </div>
-
-  <?php foreach ($profile as $field) : ?>
-    <div class="field">
-      <?php print $field->value; ?>
-    </div>
-  <?php endforeach; ?>
-
-</div>
Index: modules/profile/profile-wrapper.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile-wrapper.tpl.php,v
retrieving revision 1.3
diff -u -p -r1.3 profile-wrapper.tpl.php
--- modules/profile/profile-wrapper.tpl.php	13 Oct 2008 12:31:42 -0000	1.3
+++ modules/profile/profile-wrapper.tpl.php	13 Aug 2009 09:15:33 -0000
@@ -1,25 +0,0 @@
-<?php
-// $Id: profile-wrapper.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $
-
-/**
- * @file
- * Default theme implementation for wrapping member listings and their
- * profiles.
- *
- * This template is used when viewing a list of users. It can be a general
- * list for viewing all users with the url of "example.com/profile" or when
- * viewing a set of users who share a specific value for a profile such
- * as "example.com/profile/country/belgium".
- *
- * Available variables:
- * - $content: User account profiles iterated through profile-listing.tpl.php.
- * - $current_field: The named field being browsed. Provided here for context.
- *   The above example would result in "last_name". An alternate template name
- *   is also based on this, e.g., "profile-wrapper-last_name.tpl.php".
- *
- * @see template_preprocess_profile_wrapper()
- */
-?>
-<div id="profile">
-  <?php print $content; ?>
-</div>
Index: modules/profile/profile.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v
retrieving revision 1.26
diff -u -p -r1.26 profile.admin.inc
--- modules/profile/profile.admin.inc	31 Jul 2009 19:01:02 -0000	1.26
+++ modules/profile/profile.admin.inc	13 Aug 2009 09:15:33 -0000
@@ -1,428 +0,0 @@
-<?php
-// $Id: profile.admin.inc,v 1.26 2009/07/31 19:01:02 dries Exp $
-
-/**
- * @file
- * Administrative page callbacks for the profile module.
- */
-
-/**
- * Form builder to display a listing of all editable profile fields.
- *
- * @ingroup forms
- * @see profile_admin_overview_submit()
- */
-function profile_admin_overview() {
-  $result = db_query('SELECT title, name, type, category, fid, weight FROM {profile_field} ORDER BY category, weight');
-
-  $form = array();
-  $categories = array();
-  foreach ($result as $field) {
-    // Collect all category information
-    $categories[] = $field->category;
-
-    // Save all field information
-    $form[$field->fid]['name'] = array('#markup' => check_plain($field->name));
-    $form[$field->fid]['title'] = array('#markup' => check_plain($field->title));
-    $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/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
-  $categories = array_unique($categories);
-  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'));
-  }
-  else {
-    // Disable combo boxes when there isn't a submit button
-    foreach ($form as $fid => $field) {
-      unset($form[$fid]['weight']);
-      $form[$fid]['category']['#type'] = 'value';
-    }
-  }
-  $form['#tree'] = TRUE;
-
-  $addnewfields = '<h2>' . t('Add new field') . '</h2>';
-  $addnewfields .= '<ul>';
-  foreach (_profile_field_types() as $key => $value) {
-    $addnewfields .= '<li>' . l($value, "admin/settings/profile/add/$key") . '</li>';
-  }
-  $addnewfields .= '</ul>';
-  $form['addnewfields'] = array('#markup' => $addnewfields);
-
-  return $form;
-}
-
-/**
- * Submit handler to update changed profile field weights and categories.
- *
- * @see profile_admin_overview()
- */
-function profile_admin_overview_submit($form, &$form_state) {
-  foreach (element_children($form_state['values']) as $fid) {
-    if (is_numeric($fid)) {
-      $weight = $form_state['values'][$fid]['weight'];
-      $category = $form_state['values'][$fid]['category'];
-      if ($weight != $form[$fid]['weight']['#default_value'] || $category != $form[$fid]['category']['#default_value']) {
-        db_update('profile_field')
-          ->fields(array(
-            'weight' => $weight,
-            'category' => $category,
-          ))
-          ->condition('fid', $fid)
-          ->execute();
-      }
-    }
-  }
-
-  drupal_set_message(t('Profile fields have been updated.'));
-  cache_clear_all();
-  menu_rebuild();
-}
-
-/**
- * Theme the profile field overview into a drag and drop enabled table.
- *
- * @ingroup themeable
- * @see profile_admin_overview()
- */
-function theme_profile_admin_overview($form) {
-  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');
-  }
-
-  $rows = array();
-  $categories = array();
-  $category_number = 0;
-  foreach (element_children($form) as $key) {
-    // Don't take form control structures.
-    if (array_key_exists('category', $form[$key])) {
-      $field = &$form[$key];
-      $category = $field['category']['#default_value'];
-
-      if (!isset($categories[$category])) {
-        // 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;
-        $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 draggable 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);
-        }
-        $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];
-
-      // Add the row
-      $row = array();
-      $row[] = drupal_render($field['title']);
-      $row[] = drupal_render($field['name']);
-      $row[] = drupal_render($field['type']);
-      if (isset($form['submit'])) {
-        $row[] = drupal_render($field['category']);
-        $row[] = drupal_render($field['weight']);
-      }
-      $row[] = drupal_render($field['edit']);
-      $row[] = drupal_render($field['delete']);
-      $rows[] = array('data' => $row, 'class' => 'draggable');
-    }
-  }
-  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');
-    $header[] = t('Weight');
-  }
-  $header[] = array('data' => t('Operations'), 'colspan' => 2);
-
-  $output = theme('table', $header, $rows, array('id' => 'profile-fields'));
-  $output .= drupal_render_children($form);
-
-  return $output;
-}
-
-/**
- * Menu callback: Generate a form to add/edit a user profile field.
- *
- * @ingroup forms
- * @see profile_field_form_validate()
- * @see profile_field_form_submit()
- */
-function profile_field_form(&$form_state, $arg = NULL) {
-  if (arg(3) == 'edit') {
-    if (is_numeric($arg)) {
-      $fid = $arg;
-
-      $edit = db_query('SELECT * FROM {profile_field} WHERE fid = :fid', array('fid' => $fid))->fetchAssoc();
-
-      if (!$edit) {
-        drupal_not_found();
-        return;
-      }
-      drupal_set_title(t('edit %title', array('%title' => $edit['title'])), PASS_THROUGH);
-      $form['fid'] = array('#type' => 'value',
-        '#value' => $fid,
-      );
-      $type = $edit['type'];
-    }
-    else {
-      drupal_not_found();
-      return;
-    }
-  }
-  else {
-    $types = _profile_field_types();
-    if (!isset($types[$arg])) {
-      drupal_not_found();
-      return;
-    }
-    $type = $arg;
-    drupal_set_title(t('add new %type', array('%type' => $types[$type])), PASS_THROUGH);
-    $edit = array('name' => 'profile_');
-    $form['type'] = array('#type' => 'value', '#value' => $type);
-  }
-  $edit += array(
-    'category' => '',
-    'title' => '',
-    'explanation' => '',
-    'weight' => 0,
-    'page' => '',
-    'autocomplete' => '',
-    'required' => '',
-    'register' => '',
-  );
-  $form['fields'] = array('#type' => 'fieldset',
-    '#title' => t('Field settings'),
-  );
-  $form['fields']['category'] = array('#type' => 'textfield',
-    '#title' => t('Category'),
-    '#default_value' => $edit['category'],
-    '#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,
-  );
-  $form['fields']['title'] = array('#type' => 'textfield',
-    '#title' => t('Title'),
-    '#default_value' => $edit['title'],
-    '#description' => t('The title of the new field. The title will be shown to the user. An example title is "Favorite color".'),
-    '#required' => TRUE,
-  );
-  $form['fields']['name'] = array('#type' => 'textfield',
-    '#title' => t('Form name'),
-    '#default_value' => $edit['name'],
-    '#description' => t('The name of the field. The form name is not shown to the user but used internally in the HTML code and URLs.
-Unless you know what you are doing, it is highly recommended that you prefix the form name with <code>profile_</code> to avoid name clashes with other fields. Spaces or any other special characters except dash (-) and underscore (_) are not allowed. An example name is "profile_favorite_color" or perhaps just "profile_color".'),
-    '#required' => TRUE,
-  );
-  $form['fields']['explanation'] = array('#type' => 'textarea',
-    '#title' => t('Explanation'),
-    '#default_value' => $edit['explanation'],
-    '#description' => t('An optional explanation to go with the new field. The explanation will be shown to the user.'),
-  );
-  if ($type == 'selection') {
-    $form['fields']['options'] = array('#type' => 'textarea',
-      '#title' => t('Selection options'),
-      '#default_value' => isset($edit['options']) ? $edit['options'] : '',
-      '#description' => t('A list of all options. Put each option on a separate line. Example options are "red", "blue", "green", etc.'),
-    );
-  }
-  $form['fields']['visibility'] = array('#type' => 'radios',
-    '#title' => t('Visibility'),
-    '#default_value' => isset($edit['visibility']) ? $edit['visibility'] : PROFILE_PUBLIC,
-    '#options' => array(PROFILE_HIDDEN => t('Hidden profile field, only accessible by administrators, modules and themes.'), PROFILE_PRIVATE => t('Private field, content only available to privileged users.'), PROFILE_PUBLIC => t('Public field, content shown on profile page but not used on member list pages.'), PROFILE_PUBLIC_LISTINGS => t('Public field, content shown on profile page and on member list pages.')),
-  );
-  if ($type == 'selection' || $type == 'list' || $type == 'textfield') {
-    $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.'),
-    );
-  }
-  elseif ($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.'),
-    );
-  }
-  $form['fields']['weight'] = array('#type' => 'weight',
-    '#title' => t('Weight'),
-    '#default_value' => $edit['weight'],
-    '#description' => t('The weights define the order in which the form fields are shown. Lighter fields "float up" towards the top of the category.'),
-  );
-  $form['fields']['autocomplete'] = array('#type' => 'checkbox',
-    '#title' => t('Form will auto-complete while user is typing.'),
-    '#default_value' => $edit['autocomplete'],
-    '#description' => t('For security, auto-complete will be disabled if the user does not have access to user profiles.'),
-  );
-  $form['fields']['required'] = array('#type' => 'checkbox',
-    '#title' => t('The user must enter a value.'),
-    '#default_value' => $edit['required'],
-  );
-  $form['fields']['register'] = array('#type' => 'checkbox',
-    '#title' => t('Visible in user registration form.'),
-    '#default_value' => $edit['register'],
-  );
-  $form['submit'] = array('#type' => 'submit',
-    '#value' => t('Save field'),
-  );
-  return $form;
-}
-
-/**
- * Validate profile_field_form submissions.
- */
-function profile_field_form_validate($form, &$form_state) {
-  // Validate the 'field name':
-  if (preg_match('/[^a-zA-Z0-9_-]/', $form_state['values']['name'])) {
-    form_set_error('name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters except dash (-) and underscore (_) are not allowed.'));
-  }
-
-  $users_table = drupal_get_schema('users');
-  if (!empty($users_table['fields'][$form_state['values']['name']])) {
-    form_set_error('name', t('The specified form name is reserved for use by Drupal.'));
-  }
-  // Validate the category:
-  if (!$form_state['values']['category']) {
-    form_set_error('category', t('You must enter a category.'));
-  }
-  if (strtolower($form_state['values']['category']) == 'account') {
-    form_set_error('category', t('The specified category name is reserved for use by Drupal.'));
-  }
-  $query = db_select('profile_field');
-  $query->fields('profile_field', array('fid'));
-
-  if (isset($form_state['values']['fid'])) {
-    $query->condition('fid', $form_state['values']['fid']);
-  }
-  $query_name = clone $query;
-
-  $title = $query
-    ->condition('title', $form_state['values']['title'])
-    ->condition('category', $form_state['values']['category'])
-    ->execute()
-    ->fetchField();
-  if ($title) {
-    form_set_error('title', t('The specified title is already in use.'));
-  }
-  $name = $query_name
-    ->condition('name', $form_state['values']['name'])
-    ->execute()
-    ->fetchField();
-  if ($name) {
-    form_set_error('name', t('The specified name is already in use.'));
-  }
-  if ($form_state['values']['visibility'] == PROFILE_HIDDEN) {
-    if ($form_state['values']['required']) {
-      form_set_error('required', t('A hidden field cannot be required.'));
-    }
-    if ($form_state['values']['register']) {
-      form_set_error('register', t('A hidden field cannot be set to visible on the user registration form.'));
-    }
-  }
-}
-
-/**
- * Process profile_field_form submissions.
- */
-function profile_field_form_submit($form, &$form_state) {
-  if (!isset($form_state['values']['options'])) {
-    $form_state['values']['options'] = '';
-  }
-  if (!isset($form_state['values']['page'])) {
-    $form_state['values']['page'] = '';
-  }
-  if (!isset($form_state['values']['fid'])) {
-    // Remove all elements that are not profile_field columns.
-    $values = array_intersect_key($form_state['values'], array_flip(array('type', 'category', 'title', 'name', 'explanation', 'visibility', 'page', 'weight', 'autocomplete', 'required', 'register', 'options')));
-    db_insert('profile_field')
-      ->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/settings/profile'));
-  }
-  else {
-    db_update('profile_field')
-      ->fields($form_state['values'])
-      ->condition('fid', $form_state['values']['fid'])
-      ->exeucte();
-    drupal_set_message(t('The field has been updated.'));
-  }
-  cache_clear_all();
-  menu_rebuild();
-
-  $form_state['redirect'] = 'admin/settings/profile';
-  return;
-}
-
-/**
- * Menu callback; deletes a field from all user profiles.
- */
-function profile_field_delete(&$form_state, $fid) {
-  $field = db_query("SELECT title FROM {profile_field} WHERE fid = :fid", array(':fid' => $fid))->fetchObject();
-  if (!$field) {
-    drupal_not_found();
-    return;
-  }
-  $form['fid'] = array('#type' => 'value', '#value' => $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/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'));
-}
-
-/**
- * Process a field delete form submission.
- */
-function profile_field_delete_submit($form, &$form_state) {
-  db_delete('profile_field')
-    ->condition('fid', $form_state['values']['fid'])
-    ->execute();
-  db_delete('profile_value')
-    ->condition('fid', $form_state['values']['fid'])
-    ->execute();
-
-  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/settings/profile'));
-
-  $form_state['redirect'] = 'admin/settings/profile';
-  return;
-}
-
-/**
- * Retrieve a pipe delimited string of autocomplete suggestions for profile categories
- */
-function profile_admin_settings_autocomplete($string) {
-  $matches = array();
-  $result = db_query_range("SELECT category FROM {profile_field} WHERE LOWER(category) LIKE LOWER(:category)", array(':category' => $string . '%'), 0, 10);
-  foreach ($result as $data) {
-    $matches[$data->category] = check_plain($data->category);
-  }
-  drupal_json($matches);
-}
Index: modules/profile/profile.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.css,v
retrieving revision 1.3
diff -u -p -r1.3 profile.css
--- modules/profile/profile.css	30 Nov 2007 09:02:51 -0000	1.3
+++ modules/profile/profile.css	13 Aug 2009 09:15:33 -0000
@@ -1,11 +0,0 @@
-/* $Id: profile.css,v 1.3 2007/11/30 09:02:51 goba Exp $ */
-
-#profile-fields td.category {
-  font-weight: bold;
-}
-#profile-fields tr.category-message {
-  color: #999;
-}
-#profile-fields tr.category-populated {
-  display: none;
-}
Index: modules/profile/profile.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.info,v
retrieving revision 1.9
diff -u -p -r1.9 profile.info
--- modules/profile/profile.info	8 Jun 2009 09:23:53 -0000	1.9
+++ modules/profile/profile.info	13 Aug 2009 09:15:33 -0000
@@ -1,11 +0,0 @@
-; $Id: profile.info,v 1.9 2009/06/08 09:23:53 dries Exp $
-name = Profile
-description = Supports configurable user profiles.
-package = Core
-version = VERSION
-core = 7.x
-files[] = profile.module
-files[] = profile.admin.inc
-files[] = profile.pages.inc
-files[] = profile.install
-files[] = profile.test
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.20
diff -u -p -r1.20 profile.install
--- modules/profile/profile.install	1 Jun 2009 22:07:09 -0000	1.20
+++ modules/profile/profile.install	13 Aug 2009 09:15:33 -0000
@@ -1,169 +0,0 @@
-<?php
-// $Id: profile.install,v 1.20 2009/06/01 22:07:09 dries Exp $
-
-/**
- * @file
- * Install, update and uninstall functions for the profile module.
- */
-
-/**
- * Implement hook_install().
- */
-function profile_install() {
-  // Create tables.
-  drupal_install_schema('profile');
-}
-
-/**
- * Implement hook_uninstall().
- */
-function profile_uninstall() {
-  // Remove tables
-  drupal_uninstall_schema('profile');
-
-  variable_del('profile_block_author_fields');
-}
-
-/**
- * Implement hook_schema().
- */
-function profile_schema() {
-  $schema['profile_field'] = array(
-    'description' => 'Stores profile field information.',
-    'fields' => array(
-      'fid' => array(
-        'type' => 'serial',
-        'not null' => TRUE,
-        'description' => 'Primary Key: Unique profile field ID.',
-      ),
-      'title' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => FALSE,
-        'description' => 'Title of the field shown to the end user.',
-      ),
-      'name' => array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => 'Internal name of the field used in the form HTML and URLs.',
-      ),
-      'explanation' => array(
-        'type' => 'text',
-        'not null' => FALSE,
-        'description' => 'Explanation of the field to end users.',
-      ),
-      'category' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => FALSE,
-        'description' => 'Profile category that the field will be grouped under.',
-      ),
-      'page' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => FALSE,
-        'description' => "Title of page used for browsing by the field's value",
-      ),
-      'type' => array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => FALSE,
-        'description' => 'Type of form field.',
-      ),
-      'weight' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => 'Weight of field in relation to other profile fields.',
-      ),
-      'required' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => 'Whether the user is required to enter a value. (0 = no, 1 = yes)',
-      ),
-      'register' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => 'Whether the field is visible in the user registration form. (1 = yes, 0 = no)',
-      ),
-      'visibility' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => 'The level of visibility for the field. (0 = hidden, 1 = private, 2 = public on profile but not member list pages, 3 = public on profile and list pages)',
-      ),
-      'autocomplete' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => 'Whether form auto-completion is enabled. (0 = disabled, 1 = enabled)',
-      ),
-      'options' => array(
-        'type' => 'text',
-        'not null' => FALSE,
-        'description' => 'List of options to be used in a list selection field.',
-      ),
-    ),
-    'indexes' => array(
-      'category' => array('category'),
-    ),
-    'unique keys' => array(
-      'name' => array('name'),
-    ),
-    'primary key' => array('fid'),
-  );
-
-  $schema['profile_value'] = array(
-    'description' => 'Stores values for profile fields.',
-    'fields' => array(
-      'fid' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {profile_field}.fid of the field.',
-      ),
-      'uid' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {users}.uid of the profile user.',
-      ),
-      'value' => array(
-        'type' => 'text',
-        'not null' => FALSE,
-        'description' => 'The value for the field.',
-      ),
-    ),
-    'primary key' => array('uid', 'fid'),
-    'indexes' => array(
-      'fid' => array('fid'),
-    ),
-    'foreign keys' => array(
-      'fid' => array('profile_field' => 'fid'),
-      'uid' => array('users' => 'uid'),
-    ),
-  );
-
-  return $schema;
-}
-
-/**
- * Rename {profile_fields} table to {profile_field} and {profile_values} to {profile_value}.
- */
-function profile_update_7001() {
-  $ret = array();
-  db_rename_table($ret, 'profile_fields', 'profile_field');
-  db_rename_table($ret, 'profile_values', 'profile_value');
-  return $ret;
-}
Index: modules/profile/profile.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.js,v
retrieving revision 1.7
diff -u -p -r1.7 profile.js
--- modules/profile/profile.js	27 Apr 2009 20:19:37 -0000	1.7
+++ modules/profile/profile.js	13 Aug 2009 09:15:33 -0000
@@ -1,59 +0,0 @@
-// $Id: profile.js,v 1.7 2009/04/27 20:19:37 webchick Exp $
-(function ($) {
-
-/**
- * Add functionality to the profile drag and drop table.
- *
- * This behavior is dependent on the tableDrag behavior, since it uses the
- * objects initialized in that behavior to update the row. It shows and hides
- * a warning message when removing the last field from a profile category.
- */
-Drupal.behaviors.profileDrag = {
-  attach: function (context, settings) {
-    var table = $('#profile-fields');
-    var tableDrag = Drupal.tableDrag['profile-fields']; // Get the profile tableDrag object.
-
-    // Add a handler for when a row is swapped, update empty categories.
-    tableDrag.row.prototype.onSwap = function (swappedRow) {
-      var rowObject = this;
-      $('tr.category-message', table).each(function () {
-        // If the dragged row is in this category, but above the message row, swap it down one space.
-        if ($(this).prev('tr').get(0) == rowObject.element) {
-          // Prevent a recursion problem when using the keyboard to move rows up.
-          if ((rowObject.method != 'keyboard' || rowObject.direction == 'down')) {
-            rowObject.swap('after', this);
-          }
-        }
-        // This category has become empty
-        if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').size() == 0) {
-          $(this).removeClass('category-populated').addClass('category-empty');
-        }
-        // This category has become populated.
-        else if ($(this).is('.category-empty')) {
-          $(this).removeClass('category-empty').addClass('category-populated');
-        }
-      });
-    };
-
-    // Add a handler so when a row is dropped, update fields dropped into new categories.
-    tableDrag.onDrop = function () {
-      dragObject = this;
-      if ($(dragObject.rowObject.element).prev('tr').is('.category-message')) {
-        var categoryRow = $(dragObject.rowObject.element).prev('tr').get(0);
-        var categoryNum = categoryRow.className.replace(/([^ ]+[ ]+)*category-([^ ]+)-message([ ]+[^ ]+)*/, '$2');
-        var categoryField = $('select.profile-category', dragObject.rowObject.element);
-        var weightField = $('select.profile-weight', dragObject.rowObject.element);
-        var oldcategoryNum = weightField[0].className.replace(/([^ ]+[ ]+)*profile-weight-([^ ]+)([ ]+[^ ]+)*/, '$2');
-
-        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);
-        }
-      }
-    };
-  }
-};
-
-})(jQuery);
\ No newline at end of file
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.266
diff -u -p -r1.266 profile.module
--- modules/profile/profile.module	12 Aug 2009 12:36:04 -0000	1.266
+++ modules/profile/profile.module	13 Aug 2009 09:15:33 -0000
@@ -1,613 +0,0 @@
-<?php
-// $Id: profile.module,v 1.266 2009/08/12 12:36:04 dries Exp $
-
-/**
- * @file
- * Support for configurable user profiles.
- */
-
-/**
- * Private field, content only available to privileged users.
- */
-define('PROFILE_PRIVATE', 1);
-
-/**
- * Public field, content shown on profile page but not used on member list pages.
- */
-define('PROFILE_PUBLIC', 2);
-
-/**
- * Public field, content shown on profile page and on member list pages.
- */
-define('PROFILE_PUBLIC_LISTINGS', 3);
-
-/**
- * Hidden profile field, only accessible by administrators, modules and themes.
- */
-define('PROFILE_HIDDEN', 4);
-
-/**
- * Implement hook_help().
- */
-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>';
-      return $output;
-    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. Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") . '</p>';
-  }
-}
-
-/**
- * Implement hook_theme().
- */
-function profile_theme() {
-  return array(
-    'profile_block' => array(
-      'arguments' => array('account' => NULL, 'fields' => array()),
-      'template' => 'profile-block',
-    ),
-    'profile_listing' => array(
-      'arguments' => array('account' => NULL, 'fields' => array()),
-      'template' => 'profile-listing',
-    ),
-    'profile_wrapper' => array(
-      'arguments' => array('content' => NULL),
-      'template' => 'profile-wrapper',
-    ),
-    'profile_admin_overview' => array(
-      'arguments' => array('form' => NULL),
-      'file' => 'profile.admin.inc',
-    )
-  );
-}
-
-/**
- * Implement hook_menu().
- */
-function profile_menu() {
-  $items['profile'] = array(
-    'title' => 'User list',
-    'page callback' => 'profile_browse',
-    'access arguments' => array('access user profiles'),
-    'type' => MENU_SUGGESTED_ITEM,
-  );
-  $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/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/settings/profile/autocomplete'] = array(
-    'title' => 'Profile category autocomplete',
-    'page callback' => 'profile_admin_settings_autocomplete',
-    'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
-  );
-  $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/settings/profile/delete'] = array(
-    'title' => 'Delete field',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('profile_field_delete'),
-    'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
-  );
-  $items['profile/autocomplete'] = array(
-    'title' => 'Profile autocomplete',
-    'page callback' => 'profile_autocomplete',
-    'access arguments' => array('access user profiles'),
-    'type' => MENU_CALLBACK,
-  );
-  return $items;
-}
-
-/**
- * Implement hook_block_list().
- */
-function profile_block_list() {
-  $blocks['author-information']['info'] = t('Author information');
-  $blocks['author-information']['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE;
-  return $blocks;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function profile_block_configure($delta = '') {
-  // Compile a list of fields to show
-  $fields = array();
-  $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
-  foreach ($result as $record) {
-    $fields[$record->name] = check_plain($record->title);
-  }
-  $fields['user_profile'] = t('Link to full user profile');
-  $form['profile_block_author_fields'] = array(
-    '#type' => 'checkboxes',
-    '#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/settings/profile'))),
-  );
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function profile_block_save($delta = '', $edit = array()) {
-  variable_set('profile_block_author_fields', $edit['profile_block_author_fields']);
-}
-
-/**
- * Implement hook_block_view().
- */
-function profile_block_view($delta = '') {
-  if (user_access('access user profiles')) {
-    $output = '';
-    if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
-      $node = node_load(arg(1));
-      $account = user_load(array('uid' => $node->uid));
-
-      if ($use_fields = variable_get('profile_block_author_fields', array())) {
-        // Compile a list of fields to show.
-        $fields = array();
-        $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
-        foreach ($result as $record) {
-          // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
-          if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
-            $fields[] = $record;
-          }
-        }
-      }
-
-      if (!empty($fields)) {
-        $profile = _profile_update_user_fields($fields, $account);
-        $output .= theme('profile_block', $account, $profile, TRUE);
-      }
-
-      if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
-        $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
-      }
-    }
-
-    if ($output) {
-      $block['subject'] = t('About %name', array('%name' => $account->name));
-      $block['content'] = $output;
-      return $block;
-    }
-  }
-}
-
-/**
- * Implement hook_user_register().
- */
-function profile_user_register(&$edit, $account, $category) {
-  return profile_form_profile($edit, $account, $category, TRUE);
-}
-
-/**
- * Implement hook_user_update().
- */
-function profile_user_update(&$edit, $account, $category) {
-  return profile_save_profile($edit, $account, $category);
-}
-
-/**
- * Implement hook_user_insert().
- */
-function profile_user_insert(&$edit, $account, $category) {
-  return profile_save_profile($edit, $account, $category, TRUE);
-}
-
-/**
- * Implement hook_user_form().
- */
-function profile_user_form(&$edit, $account, $category) {
-  return profile_form_profile($edit, $account, $category);
-}
-
-/**
- * Implement hook_user_cancel().
- */
-function profile_user_cancel(&$edit, $account, $method) {
-  switch ($method) {
-    case 'user_cancel_reassign':
-    case 'user_cancel_delete':
-      db_delete('profile_value')
-        ->condition('uid', $account->uid)
-        ->execute();
-      break;
-  }
-}
-
-/**
- * Implement hook_user_load().
- */
-function profile_user_load($users) {
-  $result = db_query('SELECT f.name, f.type, v.uid, v.value FROM {profile_field} f INNER JOIN {profile_value} v ON f.fid = v.fid WHERE uid IN (:uids)', array(':uids' => array_keys($users)));
-  foreach ($result as $record) {
-    if (empty($users[$record->uid]->{$record->name})) {
-      $users[$record->uid]->{$record->name} = _profile_field_serialize($record->type) ? unserialize($record->value) : $record->value;
-    }
-  }
-}
-
-function profile_save_profile(&$edit, $account, $category, $register = FALSE) {
-  $result = _profile_get_fields($category, $register);
-  foreach ($result as $field) {
-    if (_profile_field_serialize($field->type)) {
-      $edit[$field->name] = serialize($edit[$field->name]);
-    }
-    db_merge('profile_value')
-      ->key(array(
-        'fid' => $field->fid,
-        'uid' => $account->uid,
-      ))
-      ->fields(array('value' => $edit[$field->name]))
-      ->execute();
-    // Mark field as handled (prevents saving to user->data).
-    $edit[$field->name] = NULL;
-  }
-}
-
-function profile_view_field($account, $field) {
-  // Only allow browsing of private fields for admins, if browsing is enabled,
-  // and if a user has permission to view profiles. Note that this check is
-  // necessary because a user may always see their own profile.
-  $browse = user_access('access user profiles')
-        && (user_access('administer users') || $field->visibility != PROFILE_PRIVATE)
-        && !empty($field->page);
-
-  if (isset($account->{$field->name}) && $value = $account->{$field->name}) {
-    switch ($field->type) {
-      case 'textarea':
-        return check_markup($value);
-      case 'textfield':
-      case 'selection':
-        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);
-      case 'url':
-        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
-        // 1970 on Windows. This would make the date field useless for e.g.
-        // birthdays.
-        $replace = array(
-          'd' => sprintf('%02d', $value['day']),
-          'j' => $value['day'],
-          'm' => sprintf('%02d', $value['month']),
-          'M' => map_month($value['month']),
-          'Y' => $value['year'],
-          'H:i' => NULL,
-          'g:ia' => NULL,
-        );
-        return strtr($format, $replace);
-      case 'list':
-        $values = preg_split("/[,\n\r]/", $value);
-        $fields = array();
-        foreach ($values as $value) {
-          if ($value = trim($value)) {
-            $fields[] = $browse ? l($value, 'profile/' . $field->name . '/' . $value) : check_plain($value);
-          }
-        }
-        return implode(', ', $fields);
-    }
-  }
-}
-
-/**
- * Implement hook_user_view().
- */
-function profile_user_view($account) {
-  // Show private fields to administrators and people viewing their own account.
-  if (user_access('administer users') || $GLOBALS['user']->uid == $account->uid) {
-    $result = db_query('SELECT * FROM {profile_field} WHERE visibility <> :hidden ORDER BY category, weight', array(':hidden' => PROFILE_HIDDEN));
-  }
-  else {
-    $result = db_query('SELECT * FROM {profile_field} WHERE visibility <> :private AND visibility <> :hidden ORDER BY category, weight', array(':private' => PROFILE_PRIVATE, ':hidden' => PROFILE_HIDDEN));
-  }
-
-  $fields = array();
-  foreach ($result as $field) {
-    if ($value = profile_view_field($account, $field)) {
-      $title = ($field->type != 'checkbox') ? check_plain($field->title) : NULL;
-
-      // Create a single fieldset for each category.
-      if (!isset($account->content[$field->category])) {
-        $account->content[$field->category] = array(
-          '#type' => 'user_profile_category',
-          '#title' => $field->category,
-        );
-      }
-
-      $account->content[$field->category][$field->name] = array(
-        '#type' => 'user_profile_item',
-        '#title' => $title,
-        '#markup' => $value,
-        '#weight' => $field->weight,
-        '#attributes' => array('class' => 'profile-' . $field->name),
-      );
-    }
-  }
-}
-
-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.');
-  }
-
-  if ($field->visibility == PROFILE_PRIVATE) {
-    $output .= ' ' . t('The content of this field is kept private and will not be shown publicly.');
-  }
-
-  return $output;
-}
-
-function profile_form_profile($edit, $account, $category, $register = FALSE) {
-  $result = _profile_get_fields($category, $register);
-  $weight = 1;
-  $fields = array();
-  foreach ($result as $field) {
-    $category = $field->category;
-    if (!isset($fields[$category])) {
-      $fields[$category] = array('#type' => 'fieldset', '#title' => check_plain($category), '#weight' => $weight++);
-    }
-    switch ($field->type) {
-      case 'textfield':
-      case 'url':
-        $fields[$category][$field->name] = array('#type' => 'textfield',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#maxlength' => 255,
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        if ($field->autocomplete) {
-          $fields[$category][$field->name]['#autocomplete_path'] = "profile/autocomplete/" . $field->fid;
-        }
-        break;
-      case 'textarea':
-        $fields[$category][$field->name] = array('#type' => 'textarea',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        break;
-      case 'list':
-        $fields[$category][$field->name] = array('#type' => 'textarea',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        break;
-      case 'checkbox':
-        $fields[$category][$field->name] = array('#type' => 'checkbox',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        break;
-      case 'selection':
-        $options = $field->required ? array() : array('--');
-        $lines = preg_split("/[\n\r]/", $field->options);
-        foreach ($lines as $line) {
-          if ($line = trim($line)) {
-            $options[$line] = $line;
-          }
-        }
-        $fields[$category][$field->name] = array('#type' => 'select',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#options' => $options,
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        break;
-      case 'date':
-        $fields[$category][$field->name] = array('#type' => 'date',
-          '#title' => check_plain($field->title),
-          '#default_value' => isset($edit[$field->name]) ? $edit[$field->name] : '',
-          '#description' => _profile_form_explanation($field),
-          '#required' => $field->required,
-        );
-        break;
-    }
-  }
-  return $fields;
-}
-
-/**
- * Helper function: update an array of user fields by calling profile_view_field
- */
-function _profile_update_user_fields($fields, $account) {
-  foreach ($fields as $key => $field) {
-    $fields[$key]->value = profile_view_field($account, $field);
-  }
-  return $fields;
-}
-
-/**
- * Implement hook_user_validate().
- */
-function profile_user_validate(&$edit, $account, $category) {
-  $result = _profile_get_fields($category);
-  foreach ($result as $field) {
-    if ($edit[$field->name]) {
-      if ($field->type == 'url') {
-        if (!valid_url($edit[$field->name], TRUE)) {
-          form_set_error($field->name, t('The value provided for %field is not a valid URL.', array('%field' => $field->title)));
-        }
-      }
-    }
-    elseif ($field->required && !user_access('administer users')) {
-      form_set_error($field->name, t('The field %field is required.', array('%field' => $field->title)));
-    }
-  }
-
-  return $edit;
-}
-/**
- * Implement hook_user_categories().
- */
-function profile_user_categories() {
-  $result = db_query("SELECT DISTINCT(category) FROM {profile_field}");
-  $data = array();
-  foreach ($result as $category) {
-    $data[] = array(
-      'name' => $category->category,
-      'title' => $category->category,
-      'weight' => 3,
-      'access callback' => 'profile_category_access',
-      'access arguments' => array(1, $category->category)
-    );
-  }
-  return $data;
-}
-
-/**
- * Menu item access callback - check if a user has access to a profile category.
- */
-function profile_category_access($account, $category) {
-  if (user_access('administer users') && $account->uid > 0) {
-    return TRUE;
-  }
-  else {
-    $category_visible = (bool) db_query_range('SELECT 1 FROM {profile_field} WHERE category = :category AND visibility <> :visibility', array(
-      ':category' => $category,
-      ':visibility' => PROFILE_HIDDEN
-    ), 0, 1)->fetchField();
-    return user_edit_access($account) && $category_visible;
-  }
-}
-
-/**
- * Process variables for profile-block.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $account
- * - $fields
- *
- * @see profile-block.tpl.php
- */
-function template_preprocess_profile_block(&$variables) {
-
-  $variables['user_picture'] = theme('user_picture', $variables['account']);
-  $variables['profile'] = array();
-  // Supply filtered version of $fields that have values.
-  foreach ($variables['fields'] as $field) {
-    if ($field->value) {
-      $variables['profile'][$field->name]->title = check_plain($field->title);
-      $variables['profile'][$field->name]->value = $field->value;
-      $variables['profile'][$field->name]->type = $field->type;
-    }
-  }
-
-}
-
-/**
- * Process variables for profile-listing.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $account
- * - $fields
- *
- * @see profile-listing.tpl.php
- */
-function template_preprocess_profile_listing(&$variables) {
-
-  $variables['user_picture'] = theme('user_picture', $variables['account']);
-  $variables['name'] = theme('username', $variables['account']);
-  $variables['profile'] = array();
-  // Supply filtered version of $fields that have values.
-  foreach ($variables['fields'] as $field) {
-    if ($field->value) {
-      $variables['profile'][$field->name]->title = $field->title;
-      $variables['profile'][$field->name]->value = $field->value;
-      $variables['profile'][$field->name]->type = $field->type;
-    }
-  }
-
-}
-
-/**
- * Process variables for profile-wrapper.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $content
- *
- * @see profile-wrapper.tpl.php
- */
-function template_preprocess_profile_wrapper(&$variables) {
-  $variables['current_field'] = '';
-  if ($field = arg(1)) {
-    $variables['current_field'] = $field;
-    // Supply an alternate template suggestion based on the browsable field.
-    $variables['template_files'][] = 'profile-wrapper-' . $field;
-  }
-}
-
-function _profile_field_types($type = NULL) {
-  $types = array('textfield' => t('single-line textfield'),
-                 'textarea' => t('multi-line textfield'),
-                 'checkbox' => t('checkbox'),
-                 'selection' => t('list selection'),
-                 'list' => t('freeform list'),
-                 'url' => t('URL'),
-                 'date' => t('date'));
-  return isset($type) ? $types[$type] : $types;
-}
-
-function _profile_field_serialize($type = NULL) {
-  return $type == 'date';
-}
-
-function _profile_get_fields($category, $register = FALSE) {
-  $query = db_select('profile_field');
-  if ($register) {
-    $query->condition('register', 1);
-  }
-  else {
-    // Use LOWER(:category) instead of PHP's strtolower() to avoid UTF-8 conversion issues.
-    $query->where('LOWER(category) = LOWER(:category)', array(':category' => $category));
-  }
-  if (!user_access('administer users')) {
-    $query->condition('visibility', PROFILE_HIDDEN, '<>');
-  }
-  return $query
-    ->fields('profile_field')
-    ->orderBy('category', 'ASC')
-    ->orderBy('weight', 'ASC')
-    ->execute();
-}
-
Index: modules/profile/profile.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.pages.inc,v
retrieving revision 1.18
diff -u -p -r1.18 profile.pages.inc
--- modules/profile/profile.pages.inc	26 May 2009 10:41:06 -0000	1.18
+++ modules/profile/profile.pages.inc	13 Aug 2009 09:15:33 -0000
@@ -1,138 +0,0 @@
-<?php
-// $Id: profile.pages.inc,v 1.18 2009/05/26 10:41:06 dries Exp $
-
-/**
- * @file
- * User page callbacks for the profile module.
- */
-
-/**
- * Menu callback; display a list of user information.
- */
-function profile_browse() {
-  // Ensure that the path is converted to 3 levels always.
-  list(, $name, $value) = array_pad(explode('/', $_GET['q'], 3), 3, '');
-
-  $field = db_query("SELECT DISTINCT(fid), type, title, page, visibility FROM {profile_field} WHERE name = :name", array(':name' => $name))->fetchObject();
-
-  if ($name && $field->fid) {
-    // Only allow browsing of fields that have a page title set.
-    if (empty($field->page)) {
-      drupal_not_found();
-      return;
-    }
-    // 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;
-    }
-
-    // Compile a list of fields to show.
-    $fields = db_query('SELECT name, title, type, weight, page FROM {profile_field} WHERE fid <> :fid AND visibility = :visibility ORDER BY weight', array(
-      ':fid' => $field->fid,
-      ':visibility' => PROFILE_PUBLIC_LISTINGS,
-    ))->fetchAll();
-
-    $query = db_select('users')->extend('PagerDefault');
-    $query->join('profile_value', 'v', 'u.uid = v.uid');
-    $query
-      ->fields('u', array('uid', 'access'))
-      ->condition('v.fid', $field->fid)
-      ->condition('u.access', 0, '<>')
-      ->condition('u.status', 0, '<>')
-      ->orderBy('u.access', 'DESC');
-
-    // Determine what query to use:
-    $arguments = array($field->fid);
-    switch ($field->type) {
-      case 'checkbox':
-        $query->condition('v.value', 1);
-        break;
-      case 'textfield':
-      case 'selection':
-        $query->condition('v.value', $value);
-        break;
-      case 'list':
-        $query->condition('v.value', '%' . $value . '%', 'LIKE');
-        break;
-      default:
-        drupal_not_found();
-        return;
-    }
-
-    $uids = $query
-      ->limit(20)
-      ->execute()
-      ->fetchCol();
-
-    // Load the users.
-    $users = user_load_multiple($uids);
-
-    $content = '';
-    foreach ($users as $account) {
-      $profile = _profile_update_user_fields($fields, $account);
-      $content .= theme('profile_listing', $account, $profile);
-    }
-    $output = theme('profile_wrapper', $content);
-    $output .= theme('pager', NULL);
-
-    if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') {
-      $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', $value)));
-    }
-    else {
-      $title = check_plain($field->page);
-    }
-
-    drupal_set_title($title, PASS_THROUGH);
-    return $output;
-  }
-  elseif ($name && !$field->fid) {
-    drupal_not_found();
-  }
-  else {
-    // Compile a list of fields to show.
-    $fields = db_query('SELECT name, title, type, weight, page, visibility FROM {profile_field} WHERE visibility = :visibility ORDER BY category, weight', array(':visibility' => PROFILE_PUBLIC_LISTINGS))->fetchAll();
-
-    // Extract the affected users:
-    $query = db_select('users', 'u')->extend('PagerDefault');
-    $uids = $query
-      ->fields('u', array('uid', 'access'))
-      ->condition('u.uid', 0, '>')
-      ->condition('u.status', 0, '>')
-      ->condition('u.access', 0, '>')
-      ->orderBy('u.access', 'DESC')
-      ->limit(20)
-      ->execute()
-      ->fetchCol();
-    $users = user_load_multiple($uids);
-    $content = '';
-    foreach ($users as $account) {
-      $profile = _profile_update_user_fields($fields, $account);
-      $content .= theme('profile_listing', $account, $profile);
-    }
-    $output = theme('profile_wrapper', $content);
-    $output .= theme('pager', NULL);
-
-    drupal_set_title(t('User list'));
-    return $output;
-  }
-}
-
-/**
- * Callback to allow autocomplete of profile text fields.
- */
-function profile_autocomplete($field, $string) {
-  $matches = array();
-  $autocomplete_field = (bool) db_query_range("SELECT 1 FROM {profile_field} WHERE fid = :fid AND autocomplete = 1", array(':fid' => $field), 0, 1)->fetchField();
-  if ($autocomplete_field) {
-    $values = db_query_range("SELECT value FROM {profile_value} WHERE fid = :fid AND LOWER(value) LIKE LOWER(:value) GROUP BY value ORDER BY value ASC", array(
-      ':fid' => $field,
-      ':value' => $string . '%',
-    ), 0, 10)->fetchCol();
-    foreach ($values as $value) {
-      $matches[$value] = check_plain($value);
-    }
-  }
-
-  drupal_json($matches);
-}
Index: modules/profile/profile.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.test,v
retrieving revision 1.18
diff -u -p -r1.18 profile.test
--- modules/profile/profile.test	31 Jul 2009 19:01:02 -0000	1.18
+++ modules/profile/profile.test	13 Aug 2009 09:15:33 -0000
@@ -1,335 +0,0 @@
-<?php
-// $Id: profile.test,v 1.18 2009/07/31 19:01:02 dries Exp $
-
-/**
- * A class for common methods for testing profile fields.
- */
-class ProfileTestCase extends DrupalWebTestCase {
-  protected $admin_user;
-  protected $normal_user;
-
-  function setUp() {
-    parent::setUp('profile');
-    variable_set('user_register', 1);
-
-    $this->admin_user = $this->drupalCreateUser(array('administer users', 'access user profiles'));
-
-    // This is the user whose profile will be edited.
-    $this->normal_user = $this->drupalCreateUser();
-  }
-
-  /**
-   * Create a profile field.
-   *
-   * @param $type
-   *   The field type to be created.
-   * @param $category
-   *   The category in which the field should be created.
-   * @param $edit
-   *   Additional parameters to be submitted.
-   * @return
-   *   The fid of the field that was just created.
-   */
-  function createProfileField($type = 'textfield', $category = 'simpletest', $edit = array()) {
-    $edit['title'] = $title = $this->randomName(8);
-    $edit['name'] = $form_name = 'profile_' . $title;
-    $edit['category'] = $category;
-    $edit['explanation'] = $this->randomName(50);
-
-    $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'));
-
-    // Check that the new field is appearing on the user edit form.
-    $this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category);
-
-    // Checking field.
-    if ($type == 'date') {
-      $this->assertField($form_name . '[month]', t('Found month selection field'));
-      $this->assertField($form_name . '[day]', t('Found day selection field'));
-      $this->assertField($form_name . '[year]', t('Found day selection field'));
-    }
-    else {
-      $this->assertField($form_name , t('Found form named @name', array('@name' => $form_name)));
-    }
-
-    // Checking name.
-    $this->assertText($title, t('Checking title for field %title', array('%title' => $title)));
-    // Checking explanation.
-    $this->assertText($edit['explanation'], t('Checking explanation for field %title', array('%title' => $title)));
-
-    return array(
-      'fid' => $fid,
-      'type' => $type,
-      'form_name' => $form_name,
-      'title' => $title,
-      'category' => $category,
-    );
-  }
-
-  /**
-   * Set the profile field to a random value
-   *
-   * @param $field
-   *   The field that should be set.
-   * @param $value
-   *   The value for the field, defaults to a random string.
-   * @return
-   *   The value that has been assigned to
-   */
-  function setProfileField($field, $value = NULL) {
-
-    if (!isset($value)) {
-      $value = $this->randomName();
-    }
-
-    $edit = array(
-      $field['form_name'] => $value,
-    );
-    $this->drupalPost('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
-
-    // Check profile page.
-    $content = $this->drupalGet('user/' . $this->normal_user->uid);
-    $this->assertText($field['title'], t('Found profile field with title %title', array('%title' => $field['title'])));
-
-    if ($field['type'] != 'checkbox') {
-      // $value must be cast to a string in order to be found by assertText.
-      $this->assertText("$value", t('Found profile field with value %value', array('%value' => $value)));
-    }
-
-    return $value;
-  }
-
-  /**
-   * Delete a profile field.
-   *
-   * @param $field
-   *   The field to be deleted.
-   */
-  function deleteProfileField($field) {
-    $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'])));
-  }
-}
-
-class ProfileTestFields extends ProfileTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Test single fields',
-      'description' => 'Testing profile module with add/edit/delete textfield, textarea, list, checkbox, and url fields into profile page',
-      'group' => 'Profile'
-    );
-  }
-
-  /**
-   * Test each of the field types. List selection and date fields are tested
-   * separately because they need some special handling.
-   */
-  function testProfileFields() {
-    $this->drupalLogin($this->admin_user);
-
-    // Set test values for every field type.
-    $field_types = array(
-      'textfield' => $this->randomName(),
-      'textarea' => $this->randomName(),
-      'list' => $this->randomName(),
-      'checkbox' => 1,
-      // An underscore is an invalid character in a domain name. The method randomName can
-      // return an underscore.
-      'url' => 'http://www.' . str_replace('_', '', $this->randomName(10)) . '.org',
-    );
-
-    // For each field type, create a field, give it a value and delete the field.
-    foreach ($field_types as $type => $value) {
-      $field = $this->createProfileField($type);
-      $this->setProfileField($field, $value);
-      $this->deleteProfileField($field);
-    }
-  }
-}
-
-class ProfileTestSelect extends ProfileTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Test select field',
-      'description' => 'Testing profile module with add/edit/delete a select field',
-      'group' => 'Profile'
-    );
-  }
-
-  /**
-   * Create a list selection field, give it a value, and delete the field.
-   */
-  function testProfileSelectionField() {
-    $this->drupalLogin($this->admin_user);
-
-    $edit = array(
-      'options' => implode("\n", range(1, 10)),
-    );
-    $field = $this->createProfileField('selection', 'simpletest', $edit);
-
-    $this->setProfileField($field, rand(1, 10));
-
-    $this->deleteProfileField($field);
-  }
-}
-
-class ProfileTestDate extends ProfileTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Test date field',
-      'description' => 'Testing profile module with add/edit/delete a date field',
-      'group' => 'Profile'
-    );
-  }
-
-  /**
-   * Create a date field, give it a value, and delete the field.
-   */
-  function testProfileDateField() {
-    $this->drupalLogin($this->admin_user);
-
-    variable_set('date_format_short', 'm/d/Y - H:i');
-    $field = $this->createProfileField('date');
-
-    // Set date to January 09, 1983
-    $edit = array(
-      $field['form_name'] . '[month]' => 1,
-      $field['form_name'] . '[day]' => 9,
-      $field['form_name'] . '[year]' => 1983,
-    );
-
-    $this->drupalPost('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
-
-    // Check profile page.
-    $this->drupalGet('user/' . $this->normal_user->uid);
-    $this->assertText($field['title'], t('Found profile field with title %title', array('%title' => $field['title'])));
-
-    $this->assertText('01/09/1983', t('Found date profile field.'));
-
-    $this->deleteProfileField($field);
-  }
-}
-
-class ProfileTestWeights extends ProfileTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Test field weights',
-      'description' => 'Testing profile modules weigting of fields',
-      'group' => 'Profile'
-    );
-  }
-
-  function testProfileFieldWeights() {
-    $this->drupalLogin($this->admin_user);
-
-    $category = $this->randomName();
-    $field1 = $this->createProfileField('textfield', $category, array('weight' => 1));
-    $field2 = $this->createProfileField('textfield', $category, array('weight' => -1));
-
-    $this->setProfileField($field1, $this->randomName(8));
-    $this->setProfileField($field2, $this->randomName(8));
-
-    $profile_edit = $this->drupalGet('user/' . $this->normal_user->uid . '/edit/' . $category);
-    $this->assertTrue(strpos($profile_edit, $field1['title']) > strpos($profile_edit, $field2['title']), t('Profile field weights are respected on the user edit form.'));
-
-    $profile_page = $this->drupalGet('user/' . $this->normal_user->uid);
-    $this->assertTrue(strpos($profile_page, $field1['title']) > strpos($profile_page, $field2['title']), t('Profile field weights are respected on the user profile page.'));
-  }
-}
-
-/**
- * Test profile field autocompletion and access.
- */
-class ProfileTestAutocomplete extends ProfileTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Autocompletion',
-      'description' => 'Test profile fields with autocompletion.',
-      'group' => 'Profile'
-    );
-  }
-
-  /**
-   * Tests profile field autocompletion and access.
-   */
-  function testAutocomplete() {
-    $this->drupalLogin($this->admin_user);
-
-    // Create a new profile field with autocompletion enabled.
-    $category = $this->randomName();
-    $field = $this->createProfileField('textfield', $category, array('weight' => 1, 'autocomplete' => 1));
-
-    // Enter profile field value.
-    $field['value'] = $this->randomName();
-    $this->setProfileField($field, $field['value']);
-
-    // Set some html for what we want to see in the page output later.
-    $autocomplete_html = '<input class="autocomplete" type="hidden" id="' . form_clean_id('edit-' . $field['form_name'] . '-autocomplete') . '" value="' . url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE)) . '" disabled="disabled" />';
-    $field_html = '<input type="text" maxlength="255" name="' . $field['form_name'] . '" id="' . form_clean_id('edit-' . $field['form_name']) . '" size="60" value="' . $field['value'] . '" class="form-text form-autocomplete required" />';
-
-    // Check that autocompletion html is found on the user's profile edit page.
-    $this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category);
-    $this->assertRaw($autocomplete_html, t('Autocomplete found.'));
-    $this->assertRaw('misc/autocomplete.js', t('Autocomplete JavaScript found.'));
-    $this->assertRaw('class="form-text form-autocomplete"', t('Autocomplete form element class found.'));
-
-    // Check the autocompletion path using the first letter of our user's profile
-    // field value to make sure access is allowed and a valid result if found.
-    $this->drupalGet('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
-    $this->assertResponse(200, t('Autocomplete path allowed to user with permission.'));
-    $this->assertRaw($field['value'], t('Autocomplete value found.'));
-
-    // Logout and login with a user without the 'access user profiles' permission.
-    $this->drupalLogout();
-    $this->drupalLogin($this->normal_user);
-
-    // Check that autocompletion html is not found on the user's profile edit page.
-    $this->drupalGet('user/' . $this->normal_user->uid . '/edit/' . $category);
-    $this->assertNoRaw($autocomplete_html, t('Autocomplete not found.'));
-
-    // User should be denied access to the profile autocomplete path.
-    $this->drupalGet('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
-    $this->assertResponse(403, t('Autocomplete path denied to user without permission.'));
-  }
-}
-
-class ProfileBlockTestCase extends DrupalWebTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Block availability',
-      'description' => 'Check if the author-information block is available.',
-      'group' => 'Profile',
-    );
-  }
-
-  function setUp() {
-    parent::setUp('profile');
-
-    // Create and login user
-    $admin_user = $this->drupalCreateUser(array('administer blocks'));
-    $this->drupalLogin($admin_user);
-  }
-
-  function testAuthorInformationBlock() {
-    // Set block title to confirm that the interface is availble.
-    $this->drupalPost('admin/structure/block/configure/profile/author-information', array('title' => $this->randomName(8)), t('Save block'));
-    $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
-
-    // Set the block to a region to confirm block is availble.
-    $edit = array();
-    $edit['profile_author-information[region]'] = 'footer';
-    $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
-    $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
-  }
-}
-
-  /**
-   * TODO:
-   * - Test field visibility
-   * - Test profile browsing
-   * - Test required fields
-   * - Test fields on registration form
-   * - Test updating fields
-   */
