You are here

function pathauto_nodeapi in Pathauto 5

Same name and namespace in other branches
  1. 5.2 pathauto.module \pathauto_nodeapi()
  2. 6.2 pathauto.module \pathauto_nodeapi()
  3. 6 pathauto.module \pathauto_nodeapi()

Implementation of hook_nodeapi().

File

./pathauto_node.inc, line 75

Code

function pathauto_nodeapi(&$node, $op, $teaser, $page) {
  if (module_exists('path')) {
    switch ($op) {
      case 'insert':
      case 'update':
        $placeholders = node_get_placeholders($node);
        $src = "node/{$node->nid}";
        $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->type);
        break;
      default:
        break;
    }
  }
}