/[drupal]/contributions/modules/article/pathauto.inc
ViewVC logotype

Diff of /contributions/modules/article/pathauto.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Sun Jan 6 01:55:09 2008 UTC revision 1.1.2.1, Sun Jan 6 01:55:09 2008 UTC
# Line 0  Line 1 
1    <?php // -*-php-*-
2    // $Id$
3    
4    function article_pathauto($op) {
5      switch ($op) {
6      case 'settings':
7        $settings = array();
8        $settings['module'] = 'article';
9        $settings['token_type'] = 'taxonomy';
10        $settings['groupheader'] = t('Article path settings');
11        $settings['patterndescr'] = t('Patterns for Article module');
12        $settings['patterndefault'] = t('article/[cat-raw]');
13        return (object) $settings;
14      default:
15        break;
16      }
17    }
18    
19    /**
20     * Implementation of hook_taxonomy()
21     */
22    function article_taxonomy($op, $type, $array = NULL) {
23      if ($type != 'term') {
24        return;
25      }
26    
27      $vocab = variable_get('article_vocab', '');
28      if (!is_array($vocab)) {
29        return;
30      }
31    
32      if (!in_array($array['vid'], array_values($vocab))) {
33        return;
34      }
35    
36      switch ($op) {
37      case 'insert':
38      case 'update':
39        _pathauto_include();
40        $placeholders = pathauto_get_placeholders('taxonomy', (object)$array);
41        $placeholders;
42        pathauto_create_alias('article', $op, $placeholders, 'article/'.$array['tid']);
43      default:
44        break;
45      }
46    }
47    ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2