og_blueprint_master Class Reference

Inheritance diagram for og_blueprint_master:

Inheritance graph
[legend]
Collaboration diagram for og_blueprint_master:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 239 of file og_blueprints.module.


Public Member Functions

 __call ($method, $args=NULL)
 __construct ($args)
 Load a blueprint.
 __get ($member)

Public Attributes

 $bid
 $bpid
 $bpname
 $default_page
 $did
 $enabled
 $linked
 $number_linked
 $page_title
 $path
 $published
 $show_blocks
 $vid
 $weight

Protected Member Functions

 export ()
 insert ($args=NULL)
 load ($args)

Member Function Documentation

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_master::__construct ( args  ) 

The constructor dynamically determines the method for loading the blueprint based on which args are passed in.

Parameters:
array $args An associative array of known blueprint values keyed by the respective field names of those values.

Reimplemented from og_blueprint.

Definition at line 242 of file og_blueprints.module.

00242                               {
00243     parent::__construct(array_merge($args, array('bid' => 1)));
00244     $this->number_linked = db_result(db_query("SELECT COUNT(*) FROM {og_blueprint} WHERE bid <> %d AND did = %d", $this->bid, $this->did));
00245   }

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::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::load ( args  )  [protected, inherited]

Reimplemented in og_blueprint_release.

Definition at line 102 of file og_blueprints.module.

00102                                  {
00103     $fields = og_blueprints_query_fields();
00104     foreach ($args as $member => $value) {
00105       $fq[] = $member ." = ". $fields[$member];
00106       $v[] = $this->$member;
00107     }
00108     $string = preg_replace(array('/grouptype/', '/bid/', '/bpid/', '/vid/', '/did/'), array('b.grouptype', 'b.bid', 'bp.bpid', 'bp.vid', 'bp.did'), implode(' AND ', $fq));
00109     $blueprint = db_fetch_array(db_query(<<<QUERY
00110     SELECT
00111     b.bid, b.grouptype,
00112     r.vid,
00113     bp.bpid, bp.bpname, bp.did, bp.linked, bp.enabled, bp.published, bp.default_page, bp.page_title, bp.path, bp.show_blocks, bp.weight
00114     FROM {og_blueprint} AS bp
00115     LEFT JOIN {og_bundle_revision} AS r ON bp.vid = r.vid
00116     LEFT JOIN {og_bundle} AS b ON bp.bid = b.bid
00117     WHERE $string
00118 QUERY
00119     , $v));
00120     foreach ($blueprint as $field => $value) {
00121       $this->$field = $value;
00122     }
00123   }


Member Data Documentation

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_master::$number_linked

Definition at line 240 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::$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.


The documentation for this class was generated from the following file:

Generated on Sun May 18 20:36:51 2008 for Organic Groups Blueprints by  doxygen 1.5.5