

Definition at line 399 of file og_blueprints.module.
Public Member Functions | |
| __call ($method, $args=NULL) | |
| __construct ($args) | |
| Load a blueprint. | |
| __get ($member) | |
| build_display ($nid) | |
| load ($args) | |
Public Attributes | |
| $bid | |
| $bpid | |
| $bpname | |
| $default_page | |
| $did | |
| $enabled | |
| $linked | |
| $nid | |
| $page_title | |
| $path | |
| $published | |
| $release_id | |
| $release_name | |
| $show_blocks | |
| $vid | |
| $weight | |
Protected Member Functions | |
| export () | |
| insert ($args=NULL) | |
| og_blueprint::__call | ( | $ | method, | |
| $ | args = NULL | |||
| ) | [inherited] |
Definition at line 162 of file og_blueprints.module.
00162 { 00163 switch ($method) { 00164 case 'propagate': 00165 case 'save': 00166 $this->write_to_db('update', !empty($args) ? $args : array('bid', 'vid', 'bpid', 'did', 'linked', 'enabled', 'published', 'default_page', 'page_title', 'show_blocks', 'path', 'weight')); 00167 break; 00168 00169 case 'propagate': 00170 $result = db_query("SELECT vid, bid FROM {og_bundle}"); 00171 while ($row = db_fetch_array($result)) { 00172 list ($this->vid, $this->bid) = array_values($row); 00173 $this->write_to_db('update', $args); 00174 } 00175 break; 00176 00177 case 'delete': 00178 $did_data = db_query("SELECT DISTINCT(bp.did) FROM {og_bundle} AS b INNER JOIN {og_bundle_revision} AS r ON b.vid = r.vid INNER JOIN {og_blueprint} AS bp ON b.vid = bp.vid WHERE bpid = %d"); 00179 while ($did = db_fetch_array($did_data)) { 00180 panels_delete_display($did); 00181 } 00182 db_query("DELETE bp FROM {og_bundle} AS b INNER JOIN {og_bundle_revision} AS r ON b.vid = r.vid INNER JOIN {og_blueprint} AS bp ON b.vid = bp.vid WHERE bpid = %d", $this->bpid); 00183 } 00184 }
| og_blueprint::__construct | ( | $ | args | ) | [inherited] |
The constructor dynamically determines the method for loading the blueprint based on which args are passed in.
| array | $args An associative array of known blueprint values keyed by the respective field names of those values. |
Reimplemented in og_blueprint_master.
Definition at line 95 of file og_blueprints.module.
00095 { 00096 foreach ($args as $field => $value) { 00097 $this->$field = $value; 00098 } 00099 $this->load($args); 00100 }
| og_blueprint::__get | ( | $ | member | ) | [inherited] |
Definition at line 191 of file og_blueprints.module.
00191 { 00192 if (isset($this->$member)) { 00193 return $this->$member; 00194 } 00195 switch ($member) { 00196 case 'display': 00197 case 'context': 00198 panels_load_include('plugins'); 00199 $this->display = panels_load_display($this->did); 00200 $this->context = $this->display->context = array('og_panels' => panels_context_create_empty('group')); 00201 return $member == 'display' ? $this->display : $this->context; 00202 00203 case 'content_types': 00204 panels_load_include('common'); 00205 return $this->content_types = $this->display->content_types = panels_common_get_allowed_types('og_panels', $this->context); 00206 00207 case 'grouptype': 00208 return $this->grouptype = db_result(db_query("SELECT grouptype FROM {og_bundle} WHERE bid = %d", $this->bid)); 00209 00210 } 00211 }
| og_blueprint_instantiator::build_display | ( | $ | nid | ) |
Definition at line 402 of file og_blueprints.module.
00402 { 00403 $fields = og_blueprints_query_fields(array('nid', 'did', 'published', 'page_title', 'path', 'default_page', 'show_blocks', 'weight')); 00404 $this->nid = $nid; 00405 $this->export(); 00406 foreach ($fields as $field => $value) { 00407 $f[] = $field; 00408 $q[] = $value; 00409 $v[] = $this->$field; 00410 } 00411 // FIXME naughty naughty. Should do this via drupal_execute() 00412 db_query("INSERT INTO {og_panels} (". implode(' , ', $f) .") VALUES (". implode(' , ', $q) .")", $v); 00413 db_query("INSERT INTO {og_blueprint_control} (bid, vid, bpid, nid, did_link) VALUES (%d, %d, %d, %d, %d)", $this->bid, $this->vid, $this->bpid, $this->nid, 0); // TODO if we can get did-linking going in og_panels, then just change this to 1 00414 }
| og_blueprint::export | ( | ) | [protected, inherited] |
Definition at line 125 of file og_blueprints.module.
00125 { 00126 $code = panels_export_display(panels_load_display($this->did)); 00127 eval($code); 00128 panels_save_display($display); 00129 $this->did = $display->did; 00130 }
| og_blueprint::insert | ( | $ | args = NULL |
) | [protected, inherited] |
Definition at line 186 of file og_blueprints.module.
00186 { 00187 $this->write_to_db('insert', !is_null($args) ? $args : array('bid', 'vid', 'bpid', 'bpname', 'did', 'linked', 'enabled', 'published', 'default_page', 'page_title', 'show_blocks', 'path')); 00188 }
| og_blueprint_release::load | ( | $ | args | ) | [inherited] |
Reimplemented from og_blueprint.
Definition at line 365 of file og_blueprints.module.
00365 { 00366 parent::load($args); 00367 list($this->release_id, $this->release_name) = array_values(db_fetch_array(db_query("SELECT release_id, release_name FROM {og_bundle_revision} WHERE vid = %d", $this->vid))); 00368 }
og_blueprint::$bid [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$bpid [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$bpname [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$default_page [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$did [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$enabled [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$linked [inherited] |
Definition at line 85 of file og_blueprints.module.
| og_blueprint_instantiator::$nid |
Definition at line 400 of file og_blueprints.module.
og_blueprint::$page_title [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$path [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$published [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint_release::$release_id [inherited] |
Definition at line 363 of file og_blueprints.module.
og_blueprint_release::$release_name [inherited] |
Definition at line 363 of file og_blueprints.module.
og_blueprint::$show_blocks [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$vid [inherited] |
Definition at line 85 of file og_blueprints.module.
og_blueprint::$weight [inherited] |
Definition at line 85 of file og_blueprints.module.
1.5.5