| 1 |
<?php |
<?php |
| 2 |
// $Id: recipe.module,v 1.83 2009/06/26 11:53:01 marble Exp $ |
// $Id: recipe.module,v 1.84 2009/06/26 12:18:11 marble Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 1352 |
} |
} |
| 1353 |
|
|
| 1354 |
/** |
/** |
| 1355 |
|
* Hook into generic node creation/update and check if the added node |
| 1356 |
|
* fixes any links in existing recipes. |
| 1357 |
|
*/ |
| 1358 |
|
function recipe_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { |
| 1359 |
|
switch ($op) { |
| 1360 |
|
case 'insert': |
| 1361 |
|
case 'update': |
| 1362 |
|
// TODO: Could filter for only nodes of type 'ingredient' |
| 1363 |
|
db_query("UPDATE {recipe_ingredient} SET link='%d' WHERE LOWER(name)='%s'", $node->nid, trim(strtolower($node->title)) ); |
| 1364 |
|
break; |
| 1365 |
|
} |
| 1366 |
|
} |
| 1367 |
|
|
| 1368 |
|
/** |
| 1369 |
* Helper function for array map purposes. |
* Helper function for array map purposes. |
| 1370 |
* @param term the term object from which the tid will be extracted. |
* @param term the term object from which the tid will be extracted. |
| 1371 |
* |
* |