| 1 |
<?php |
<?php |
| 2 |
// $Id: autotagging.module,v 1.2 2009/07/01 21:15:53 acstewart Exp $ |
// $Id: autotagging.module,v 1.3 2009/07/03 01:11:59 acstewart Exp $ |
| 3 |
/* |
/* |
| 4 |
* @file autotagging.module |
* @file autotagging.module |
| 5 |
* Module for base Autotagging API. |
* Module for base Autotagging API. |
| 33 |
// act on the node |
// act on the node |
| 34 |
// |
// |
| 35 |
switch ($op) { |
switch ($op) { |
|
case 'update': |
|
| 36 |
case 'delete': |
case 'delete': |
| 37 |
// TODO: delete existing terms for this node |
// TODO: delete existing terms for this node |
| 38 |
// |
// |
| 39 |
|
case 'update': |
| 40 |
case 'insert': |
case 'insert': |
| 41 |
$terms = array(); |
$terms = array(); |
| 42 |
// check that this node type is allowed for autotagging |
// check that this node type is allowed for autotagging |
| 64 |
break; |
break; |
| 65 |
} |
} |
| 66 |
} |
} |
| 67 |
|
foreach (module_implements('autotagging_api_presave') as $module) { |
| 68 |
|
// allows modules to act on terms before they're saved. |
| 69 |
|
module_invoke($module_name, 'autotagging_api_presave', $node, $terms); |
| 70 |
|
} |
| 71 |
if (isset($terms) && is_array($terms) && !empty($terms)) { |
if (isset($terms) && is_array($terms) && !empty($terms)) { |
| 72 |
// find the vocabulary with which to associate these terms |
// find the vocabulary with which to associate these terms |
| 73 |
// |
// |