| 1366 |
*/ |
*/ |
| 1367 |
function og_blueprints_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { // TODO add hook here to check for updates |
function og_blueprints_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { // TODO add hook here to check for updates |
| 1368 |
if ($op == 'insert' && $bundle_mode = og_blueprints_mode()) { |
if ($op == 'insert' && $bundle_mode = og_blueprints_mode()) { |
| 1369 |
if (in_array($group_type = $node->type, array_keys(og_blueprints_group_types()))) { |
// Ensures that a release has been created, and that that release has some |
| 1370 |
|
// displays in it before trying to instantiate. TODO move to instantiator |
| 1371 |
|
if (db_result(db_query("SELECT release_id FROM {og_bundle} AS b INNER JOIN {og_blueprint} AS bp ON b.vid = bp.vid WHERE b.grouptype = '%s'", $node->type))) { |
| 1372 |
$bundle = new og_bundle_instantiator($node->nid, $group_type); |
$bundle = new og_bundle_instantiator($node->nid, $group_type); |
| 1373 |
$bundle->instantiate(); |
$bundle->instantiate(); |
| 1374 |
} |
} |