You are here

function user_pathauto in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto_user.inc \user_pathauto()
  2. 5 pathauto_user.inc \user_pathauto()
  3. 6.2 pathauto.module \user_pathauto()
  4. 7 pathauto.module \user_pathauto()

Implements hook_pathauto().

File

./pathauto_user.inc, line 13
Hook implementations for user module integration.

Code

function user_pathauto($op) {
  switch ($op) {
    case 'settings':
      $settings = array();
      $settings['module'] = 'user';
      $settings['token_type'] = 'user';
      $settings['groupheader'] = t('User paths');
      $settings['patterndescr'] = t('Pattern for user account page paths');
      $settings['patterndefault'] = 'users/[user-raw]';
      $patterns = token_get_list('user');
      foreach ($patterns as $type => $pattern_set) {
        if ($type != 'global') {
          foreach ($pattern_set as $pattern => $description) {
            $settings['placeholders']['[' . $pattern . ']'] = $description;
          }
        }
      }
      $settings['bulkname'] = t('Bulk generate aliases for users that are not aliased');
      $settings['bulkdescr'] = t('Generate aliases for all existing user account pages which do not already have aliases.');
      return (object) $settings;
    default:
      break;
  }
}