You are here

function _taxonomy_pathauto in Pathauto 6.2

Implements hook_pathauto().

1 call to _taxonomy_pathauto()
taxonomy_pathauto in ./pathauto.module
Implements hook_pathauto() on behalf of taxonomy.module.

File

./pathauto.pathauto.inc, line 93
Pathauto integration for core modules.

Code

function _taxonomy_pathauto($op) {
  switch ($op) {
    case 'settings':
      $settings = array();
      $settings['module'] = 'taxonomy';
      $settings['token_type'] = 'taxonomy';
      $settings['groupheader'] = t('Taxonomy term paths');
      $settings['patterndescr'] = t('Default path pattern (applies to all vocabularies with blank patterns below)');
      $settings['patterndefault'] = '[vocab-raw]/[catpath-raw]';
      $settings['batch_update_callback'] = 'taxonomy_pathauto_bulk_update_batch_process';
      $settings['batch_file'] = drupal_get_path('module', 'pathauto') . '/pathauto.pathauto.inc';
      $vocabularies = taxonomy_get_vocabularies();
      if (count($vocabularies)) {
        $settings['patternitems'] = array();
        foreach ($vocabularies as $vid => $vocabulary) {
          if ($vid == variable_get('forum_nav_vocabulary', '')) {

            // Skip the forum vocabulary.
            continue;
          }
          $settings['patternitems'][$vid] = t('Pattern for all %vocab-name paths', array(
            '%vocab-name' => $vocabulary->name,
          ));
        }
      }
      return (object) $settings;
    default:
      break;
  }
}