You are here

function faq_pathauto in Frequently Asked Questions 6

Same name and namespace in other branches
  1. 5.2 faq.module \faq_pathauto()
  2. 7.2 faq.module \faq_pathauto()
  3. 7 faq.module \faq_pathauto()

Implements hook_pathauto().

File

./faq.module, line 1338
The FAQ module allows users to create a FAQ page, with questions and answers displayed in different styles, according to the settings.

Code

function faq_pathauto($op) {
  switch ($op) {
    case 'settings':
      $settings = array();
      $settings['module'] = 'faq';
      $settings['token_type'] = 'taxonomy';
      $settings['groupheader'] = t('FAQ category path settings');
      $settings['patterndescr'] = t('Default path pattern (applies to all FAQ categories with blank patterns below)');
      $settings['patterndefault'] = t('faq/[catpath-raw]');
      $patterns = token_get_list('taxonomy');
      foreach ($patterns as $type => $pattern_set) {
        if ($type != 'global') {
          foreach ($pattern_set as $pattern => $description) {
            $settings['placeholders']['[' . $pattern . ']'] = $description;
          }
        }
      }
      return (object) $settings;
    default:
      break;
  }
}