| 1 |
<?php |
<?php |
| 2 |
// $Id: og_blueprints.module,v 1.1.2.18 2008/09/15 18:41:36 sdboyer Exp $ |
// $Id: og_blueprints.module,v 1.1.2.19 2008/09/15 18:43:14 sdboyer Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file og_blueprints.module |
* @file og_blueprints.module |
| 354 |
"SELECT b.bid, r.vid FROM {og_bundle} AS b INNER JOIN {og_bundle_revision} AS r ON b.bid = r.bid WHERE b.grouptype = '%s' AND r.release_id = %d", |
"SELECT b.bid, r.vid FROM {og_bundle} AS b INNER JOIN {og_bundle_revision} AS r ON b.bid = r.bid WHERE b.grouptype = '%s' AND r.release_id = %d", |
| 355 |
$this->grouptype, $this->release_id))); |
$this->grouptype, $this->release_id))); |
| 356 |
$this->loadAllBlueprints(); |
$this->loadAllBlueprints(); |
| 357 |
$this->blueprints = array_filter($this->blueprints, array($this, 'filter_disabled')); // TODO should this be here? probably. |
$this->blueprints = array_filter($this->blueprints, array($this, 'filterDisabled')); // TODO should this be here? probably. |
| 358 |
} |
} |
| 359 |
|
|
| 360 |
protected function filterDisabled($item) { |
protected function filterDisabled($item) { |
| 1369 |
// Ensures that a release has been created, and that that release has some |
// 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 |
// 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))) { |
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, $node->type); |
| 1373 |
$bundle->instantiate(); |
$bundle->instantiate(); |
| 1374 |
} |
} |
| 1375 |
} |
} |