og_blueprints.module File Reference


Detailed Description

Bundles are sets of panels (as in the Panels and OG Panels modules) that can be paired with group types. Once a bundle of panels has been paired with a group type, every new group of that type will automatically be granted their own duplicate set of the panels in the bundle.

ABBREVIATIONS UTILIZED IN THIS MODULE:

Definition in file og_blueprints.module.

Go to the source code of this file.

Classes

class  og_blueprint
class  og_blueprint_instantiator
class  og_blueprint_master
class  og_blueprint_new
class  og_blueprint_new_release
class  og_blueprint_release
class  og_blueprint_type_creator
class  og_blueprint_typed
class  og_blueprints_help
 Object interface for pulling relevant help & informational text out of the .inc file. More...
class  og_bundle
 Definition of the base abstract class for og_bundles. More...
class  og_bundle_instantiator
 Class simply creates a release bundle using the preferred release. More...
class  og_bundle_master
class  og_bundle_new_release
class  og_bundle_release
 Constructs an og_bundle object with data from a specific release version. More...
class  og_bundle_type_creator
class  og_bundle_type_remover
class  og_bundle_typed

Functions

 og_blueprints_admin ()
 Render the form to configure general settings for OG Blueprints.
 og_blueprints_admin_blueprintsetup ($type= 'master')
 Render the page containing blueprint-specific configuration links.
 og_blueprints_admin_bundlecfg ($type= 'master')
 Render the form for bundle configuration.
 og_blueprints_admin_submit ($form, $form_values)
 og_blueprints_blueprint_delete_confirm ($bpid)
 og_blueprints_blueprint_delete_confirm_submit ($form_id, $form_values)
 og_blueprints_blueprint_edit ($op, $bpid, $type= 'master')
 og_blueprints_blueprint_form ($bpid=0, $type= 'master')
 Form to add/edit a blueprint.
 og_blueprints_blueprint_form_submit ($form_id, $form_values)
 Creates a new panel blueprint, or modifies an existing one.
 og_blueprints_blueprint_form_validate ($form_id, $form)
 og_blueprints_blueprint_relink_confirm ($did)
 og_blueprints_blueprint_relink_confirm_submit ($form_id, $form_values)
 og_blueprints_bundle_removal_confirm_submit ($form_id, $form_values)
 og_blueprints_bundle_removal_form (&$form, $bundle)
 FAPI widget code to generate a form widget for handling the removal of bundles.
 og_blueprints_bundlecfg_table ($type, $ismaster, $bundle)
 FAPI definition for the configure overall bundle settings form.
 og_blueprints_bundlecfg_table_submit ($form_id, $form_values)
 Submit form changes to class methods for saving to the db.
 og_blueprints_content_push ()
 og_blueprints_create_release ($grouptype)
 og_blueprints_create_release_submit ($form_id, $form_values)
 og_blueprints_form_alter ($form_id, &$form)
 Implementation of hook_form_alter().
 og_blueprints_group_types ($master=FALSE)
 Return the list of node types that have been classified by og as groups.
 og_blueprints_help ($section)
 Implementation of hook_help().
 og_blueprints_list ($refresh=FALSE)
 Return an associative array of bpnames, keyed by their corresponding bpid.
 og_blueprints_menu ($may_cache)
 Implementation of hook_menu().
 og_blueprints_mode ($new_setting=NULL)
 og_blueprints_nodeapi (&$node, $op, $a3=NULL, $a4=NULL)
 Implementation of hook_nodeapi().
 og_blueprints_og_node_type_form_submit ($form_id, $form_values)
 og_blueprints_perm ()
 Implementation of hook_perm().
 og_blueprints_query_fields ($passed=NULL)
 An implementation of hook_node_type.
 og_blueprints_release_overview ()
 Render the releases overview table.
 og_blueprints_sort_bundle ($a, $b)
 Specialized sort function.
 og_blueprints_sync_bundles_with_node_types ()
 Ensure that the og_bundle table has a completely up-to-date listing of all available group types.
 theme_og_blueprints_admin_dashboard ($bundle)
 Theme the instructional/informational upper portion of several og_blueprints admin pages.
 theme_og_blueprints_bundlecfg_table ($form)
 Theme the bundle settings form into a table.


Function Documentation

og_blueprints_admin (  ) 

Returns:
void

Definition at line 1289 of file og_blueprints.module.

01289                                {
01290   $help = new og_blueprints_help('dashboard');
01291   $op = og_blueprints_mode();
01292   $form['og_blueprints']['helptext'] = array('#value' => $help->help('inline', 'mode'));
01293   $form['og_blueprints']['bundlesetting'] = array(
01294     '#type' => 'radios',
01295     '#title' => t('OG Blueprints Operating Mode'),
01296     '#options' => array('Disabled', 'Enabled - One Overall Bundle', 'Enabled - One Bundle Per Group Type'),
01297     '#default_value' => $op,
01298     '#required' => TRUE,
01299   );
01300   $form['submit'] = array(
01301     '#type' => 'submit',
01302     '#value' => t('Select Operating Mode'),
01303   );
01304   return $form;
01305 }

og_blueprints_admin_blueprintsetup ( type = 'master'  ) 

Parameters:
string $type The group type for which the bundle settings are being edited.
Returns:
string $output String of HTML that has (already) been rendered by the theme('page') function... TODO split this into a separate function so it can be themed

Definition at line 949 of file og_blueprints.module.

00949                                                               {
00950   if (count(og_blueprints_list()) == 0) {
00951     drupal_set_message(t("You need to HAVE a blueprint before you can edit one! So, create one here."));
00952     drupal_goto('admin/og/og_blueprints/blueprint/form');
00953   }
00954   $group_types = og_blueprints_group_types(TRUE);
00955   $ismaster = $type == 'master' ? TRUE : FALSE;
00956   $bundle = $ismaster ? new og_bundle_master() : new og_bundle_typed($type);
00957   $multi = ($bundle_mode = og_blueprints_mode()) == 2 ? TRUE : FALSE;
00958   drupal_set_title($multi ? "'". $group_types[$type] ."' Blueprints" : 'Master Blueprints');
00959 
00960   $rows = array();
00961   $last_status = 'none';
00962   $colspan = $bundle_mode == 1 ? 4 : $bundle instanceof og_bundle_typed ? 6 : 5;
00963   foreach ($bundle->blueprints as $bpid => $blueprint) {
00964     if ($blueprint->default_page) {
00965       $rows[] = array(array('data' => t('Home Page Blueprint'), 'class' => 'region', 'colspan' => $colspan));
00966       $last_status = 'home';
00967     }
00968     elseif ($blueprint->enabled) {
00969       if (in_array($last_status, array('home', 'none'))) {
00970         $rows[] = array(array('data' => t('Enabled Blueprints'), 'class' => 'region', 'colspan' => $colspan));
00971       }
00972       $last_status = 'enabled';
00973     }
00974     elseif (!$blueprint->enabled) {
00975       if ($last_status != 'disabled') {
00976         $rows[] = array(array('data' => t('Disabled Blueprints'), 'class' => 'region', 'colspan' => $colspan));
00977       }
00978       $last_status = 'disabled';
00979     }
00980     $bpid = $blueprint->bpid;
00981     $row['page_title'] = $blueprint->page_title;
00982     // $row['default_page'] = $blueprint->default_page ? 'Yes' : 'No';
00983     if (!$ismaster) {
00984       $row['linked'] = $blueprint->linked ? 'Yes' : 'No';
00985       $row['relink'] = $blueprint->linked ? 'Already Linked' : l(t('Restore Link'), "admin/og/og_blueprints/blueprint/relink/$blueprint->did", array(), drupal_get_destination());
00986       // $row['import'] = 'Coming Soon'; TODO do it or don't, but don't let it sit
00987     }
00988     elseif ($multi) {
00989       $row['number_linked'] = $blueprint->number_linked == 0 ? $none_linked = t('Delinked in all bundles') : $blueprint->number_linked;
00990     }
00991     if ($blueprint->enabled) {
00992       $edit_url = $bpid . ($ismaster ? '' : "/". $type);
00993       $row['content'] = l(t('Panel Content'), "admin/og/og_blueprints/blueprint/edit/content/$edit_url", array(), drupal_get_destination());
00994       $row['layout'] = l(t('Panel Layout'), "admin/og/og_blueprints/blueprint/edit/layout/$edit_url", array(), drupal_get_destination());
00995       $row['layset'] = l(t('Panel Layout Settings'), "admin/og/og_blueprints/blueprint/edit/layset/$edit_url", array(), drupal_get_destination());
00996     }
00997     else {
00998       $row['filler'] = array('data'=> t('<em>This blueprint is currently disabled in this bundle.</em>'), 'align' => 'center', 'colspan' => 3);
00999     }
01000     $rows[] = $row;
01001     unset ($row);
01002   }
01003 
01004   $header = array(t('Panel Name'));
01005   if (!$ismaster) {
01006     $header[] = t('Tied to Master?');
01007     $header[] = t('Relink to Master');
01008     // $header[] = t('Import');
01009   }
01010   elseif ($multi) {
01011     $header[] = t('Linked Blueprints');
01012   }
01013   $header[] = array('data' => t('Panels Editing Operations'), 'align' => 'center', 'colspan' => 3);
01014 
01015   $output = theme('og_blueprints_admin_dashboard', $bundle);
01016   $help = new og_blueprints_help('mainform');
01017   return $output . theme('table', $header, $rows, array('class' => 'og-blueprint-admin-table'), $help->help('caption', arg(3), $bundle));
01018 }

og_blueprints_admin_bundlecfg ( type = 'master'  ) 

Definition at line 787 of file og_blueprints.module.

00787                                                          {
00788   if (count(og_blueprints_list()) == 0) {
00789     drupal_set_message("You need to create at least one blueprint before this module can operate. Use this form to create your first one.");
00790     drupal_goto('admin/og/og_blueprints/blueprint/form');
00791   }
00792   $group_types = og_blueprints_group_types(TRUE);
00793   $ismaster = $type == 'master' ? TRUE : FALSE;
00794   drupal_set_title(og_blueprints_mode == 2 ? "'". $group_types[$type] ."' Bundle" : "Bundle Setup");
00795   $bundle = $ismaster ? new og_bundle_master() : new og_bundle_typed($type);
00796   $output .= theme('og_blueprints_admin_dashboard', $bundle);
00797   return $output . drupal_get_form('og_blueprints_bundlecfg_table', $type, $ismaster, $bundle);
00798 }

og_blueprints_admin_submit ( form,
form_values 
)

Definition at line 1307 of file og_blueprints.module.

01307                                                          {
01308   $old_mode = og_blueprints_mode();
01309   if ($old_mode != $form_values['bundlesetting']) {
01310     $help = new og_blueprints_help('mode');
01311     og_blueprints_mode($form_values['bundlesetting']);
01312     drupal_set_message($help->help('submit', ''));
01313     // ensures that we've always got an entirely fresh set of bundles
01314     // whenever blueprints' mode changes.
01315     og_blueprints_sync_bundles_with_node_types();
01316   }
01317   else {
01318     drupal_set_message('No changes to the operating mode were made.');
01319   }
01320   return NULL;
01321 }

og_blueprints_blueprint_delete_confirm ( bpid  ) 

Definition at line 1163 of file og_blueprints.module.

01163                                                        {
01164   $blueprint = new og_blueprint_master(array('bpid' => $bpid));
01165   $form['blueprint_data'] = array('#type' => 'value', '#value' => serialize($blueprint));
01166 
01167   return confirm_form($form,
01168   t("Are you sure you want to delete the '%title' blueprint?", array('%title' => $blueprint->bpname)),
01169     'admin/og/og_blueprints/bundlecfg',
01170   t('This action CANNOT be undone.'),
01171   t('Delete'), t('Cancel')
01172   );
01173 }

og_blueprints_blueprint_delete_confirm_submit ( form_id,
form_values 
)

Definition at line 1175 of file og_blueprints.module.

01175                                                                                { // FIXME needs to be extended to include purge/paint-over delete options
01176   $blueprint = unserialize($form_values['blueprint_data']);
01177   $blueprint->delete();
01178   drupal_set_message(t('%title has been deleted.', array('%title' => $blueprint->bpname)));
01179 }

og_blueprints_blueprint_edit ( op,
bpid,
type = 'master' 
)

Definition at line 1181 of file og_blueprints.module.

01181                                                                     {
01182   $blueprint_type = 'og_blueprint_' . ($type == 'master' ? 'master' : 'typed');
01183   $blueprint = new $blueprint_type(array('bpid' => $bpid, 'grouptype' => $type));
01184   if ($blueprint instanceof og_blueprint_typed && $blueprint->linked) {
01185     if (isset($_POST['op']) && $_POST['op'] == t('Cancel')) {
01186       drupal_set_message(t('Editing operation cancelled. The blueprint was NOT delinked from the master version.'));
01187       drupal_goto();
01188     }
01189     elseif (!isset($_POST['op'])) {
01190       $group_types = og_blueprints_group_types();
01191       $newdisplay = 'NOTE: This blueprint is currently linked to the master blueprint; you are editing a temporary clone of that blueprint. Clicking "Save" will delink clone the Master, save your changes to the clone, and delink this blueprint.';
01192       drupal_set_message(t($newdisplay, array('!grouptype' => $group_types[$blueprint->grouptype])));
01193       $delinking = TRUE;
01194     }
01195   }
01196   elseif ($blueprint->number_linked == 0) {
01197     drupal_set_message(t("None of your other bundles are currently linked with this Master blueprint. You are still free to edit the panels configuration for this blueprint, but your changes will not be part of a release unless you relink a typed blueprint to this one."));
01198   }
01199   switch ($op) {
01200     case 'content':
01201       $saved = panels_edit($blueprint->display, NULL, $blueprint->content_types);
01202       break;
01203     case 'layout':
01204       $saved = panels_edit_layout($blueprint->display, isset($delinking) ? t('Save and Delink Blueprint') : t('Save'), NULL);
01205       break;
01206     case 'layset':
01207       $saved = panels_edit_layout_settings($blueprint->display, isset($delinking) ? t('Save, Delink, and Finish Editing') : t('Save and Finish Editing'), NULL);
01208       break;
01209   }
01210 
01211   if (!isset($_POST['op'])) {
01212     if ($op == 'content') {
01213       print theme('page', $saved, FALSE);
01214     }
01215     else return $saved;
01216   }
01217   elseif (in_array($_POST['op'], array(t('Save'), t('Save and Delink Blueprint')))) {
01218     if ($blueprint instanceof og_blueprint_typed && $blueprint->linked) {
01219       $blueprint->delink();
01220     }
01221     $blueprint->save();
01222 
01223     drupal_set_message(t('The settings for this blueprint have been successfully updated.'));
01224     drupal_goto();
01225   }
01226 }

og_blueprints_blueprint_form ( bpid = 0,
type = 'master' 
)

if a bpid & type are passed in, it edits that blueprint. if there's not, it creates a new blueprint.

Definition at line 1023 of file og_blueprints.module.

01023                                                                    {
01024   $blueprint = $bpid === 0 ? new og_blueprint_new() : new og_blueprint(array('bpid' => $bpid, 'grouptype' => $type));
01025   $form['bpid'] = array('#type' => 'value', '#value' => $bpid);
01026   $form['#redirect'] = !$bpid ? FALSE : TRUE;
01027   $form['blueprint_data'] = array('#type' => 'value', '#value' => serialize($blueprint));
01028   drupal_set_title($bpid ? "Configure '$blueprint->page_title' Blueprint" : "New Blueprint");
01029 
01030   $form['#tree'] = TRUE;
01031   if (!$bpid) {
01032     $form['bpvals']['bpname'] = array(
01033       '#title' => t('Blueprint System Name'),
01034       '#type' => 'textfield',
01035       '#required' => TRUE,
01036       '#default_value' => $blueprint->bpname,
01037       '#description' => t('The internal system name for this blueprint. Only sitewide OG Blueprints administrators will ever see this value. Alphanumerics, dashes, and underscores only. Note that you will NOT be able to change this later.'),
01038       '#size' => 32,
01039     );
01040   }
01041   $form['bpvals']['page_title'] = array(
01042     '#title' => t('Blueprint Title'),
01043     '#type' => 'textfield',
01044     '#required' => TRUE,
01045     '#default_value' => $blueprint->page_title,
01046     '#description' => t('The default title for og panels (and corresponding navigation tabs) that are instantiated from this blueprint.'),
01047     '#size' => 32,
01048   );
01049   $form['bpvals']['path'] = array(
01050     '#title' => t('Default Path'),
01051     '#type' => 'textfield',
01052     '#default_value' => $blueprint->default_page ? '' : $blueprint->path,
01053     '#required' => $blueprint->default_page ? FALSE : TRUE,
01054     '#description' => $blueprint->default_page ? t('This blueprint is currently set to act as the group home page and therefore cannot be assigned a default path.') : t('The default path where og panels instantiated by this blueprint will reside.'),
01055     '#disabled' => $blueprint->default_page ? TRUE : FALSE,
01056     '#size' => 32,
01057   );
01058   $form['bpvals']['show_blocks'] = array(
01059     '#title' => t('Show blocks'),
01060     '#type' => 'checkbox',
01061     '#default_value' => $blueprint->show_blocks,
01062     '#description' => t('If unchecked, OG Panels instantiated by this blueprint will hide group blocks by default.'),
01063   );
01064   $form['bpvals']['published'] = array(
01065     '#type' => 'checkbox',
01066     '#title' => t('Published'),
01067     '#default_value' => $blueprint->published,
01068     '#description' => t('If unchecked, OG Panels instantiated by this blueprint will initially be unpublished and viewable only by site or group administrators. Keeping this unchecked is wise if the page contains information that is not automatically present on group creation, and having this page accessible but empty would reflect poorly on the group.'),
01069   );
01070   $form['propagate'] = array('#type' => 'hidden', '#value' => 1); // we propagate under most circumstances, so set & hide it by default
01071   $form['bpvals']['enabled'] = array('#type' => 'hidden', '#value' => TRUE);
01072   if (2 == $bundle_mode = og_blueprints_mode()) {
01073     if (!$bpid) {
01074       $form['bpvals']['enabled'] = array(
01075         '#type' => 'checkbox',
01076         '#title' => t('Enabled (in the Bundle)'),
01077         '#default_value' => TRUE,
01078         '#description' => t("Check this box to automatically set this blueprint as 'Enabled' in all of your bundles. Note that your choices for the other values - 'Published', 'Show Blocks,' and the rest - will be applied to this blueprint in all your bundles regardless of whether or not you check this box."),
01079       );
01080     }
01081     else {
01082       $form['propagate'] = array(
01083         '#title' => t('Apply these settings to this blueprint in all bundles.'),
01084         '#type' => 'checkbox',
01085         '#default_value' => FALSE,
01086         '#description' => t("Check this box if you want the changes you have made to this blueprint to be applied across all bundles. Note that this has NO effect on the blueprint's panel display configurations (content, layout, layout settings) whatsoever, nor does it affect any default linking/delinking you may have done. It simply 'resets' the overall configuration for this blueprint to be the same across all your bundles."),
01087       );
01088     }
01089   }
01090   unset($form['#redirect']);
01091   $form['submit'] = array(
01092     '#type' => 'submit',
01093     '#value' => is_null($bpid) ? t('Update blueprint') : t('Create new blueprint'),
01094   );
01095   return $form;
01096 }

og_blueprints_blueprint_form_submit ( form_id,
form_values 
)

Also ensures that all relevant bundles are updated with the new panel information.

Definition at line 1128 of file og_blueprints.module.

01128                                                                      {
01129   $blueprint = unserialize($form_values['blueprint_data']);
01130   foreach ($form_values['bpvals'] as $member => $value) {
01131     $blueprint->$member = $value;
01132   }
01133   if ($blueprint instanceof og_blueprint_new) {
01134     $blueprint->save();
01135     drupal_set_message(t("The blueprint '%title' was created. You must now select a layout.", array('%title' => $blueprint->bpname)));
01136     return array('admin/og/og_blueprints/blueprint/edit/layout/'. $blueprint->bpid, 'destination=/admin/og/og_blueprints/bundlecfg');
01137   }
01138   $fields = array('bid', 'vid', 'bpid', 'enabled', 'published', 'default_page', 'page_title', 'show_blocks', 'path');
01139   drupal_set_message(t("The blueprint '%title' was updated."));
01140   !empty($form_values['propagate']) ? $blueprint->propagate($fields) : $blueprint->save($fields);
01141   return 'admin/og/og_blueprints/bundlecfg/'. $blueprint->grouptype;
01142 }

og_blueprints_blueprint_form_validate ( form_id,
form 
)

Definition at line 1098 of file og_blueprints.module.

01098                                                                 {
01099   global $form_values;
01100   $blueprint = unserialize($form_values['blueprint_data']);
01101   $pathblacklist = array('view', 'edit', 'delete', 'outline', 'load', 'render', 'clone');
01102   if (in_array($form_values['bpvals']['path'], $pathblacklist)) {
01103     form_error($form['bpvals']['path'], t('%path is a reserved system path, and cannot be used for a group page. Please enter another path.', array('%path' => $form_values['path'])));
01104   }
01105   else if (preg_match("/[^A-Za-z0-9-]/", $form_values['bpvals']['path'])) {
01106     form_error($form['bpvals']['path'], t("Panel paths may only contain alphanumeric characters and dashes."));
01107   }
01108   else if (db_result(db_query("SELECT bp.path FROM {og_bundle} b LEFT JOIN {og_blueprint} bp ON b.vid = bp.vid WHERE bp.path = '%s' AND b.grouptype = '%s' AND bp.bpid <> %d", $form_values['bpvals']['path'], $form_values['bpid'], $blueprint->grouptype))) {
01109     form_error($form['bpvals']['path'], t("That path is currently in use by another one of your group's pages. Please enter another path."));
01110   }
01111   if (isset($form_values['bpvals']['bpname'])) {
01112     if (preg_match("/[^A-Za-z0-9_-]/", $form_values['bpvals']['bpname'])) {
01113       form_error($form['bpname'], t("System names can only contain alphanumeric characters, underscores, and dashes."));
01114     }
01115     elseif (!preg_match("/[A-Za-z_-]/", $form_values['bpvals']['bpname'])) {
01116       form_error($form['bpname'], t("System names must contain at least one non-numeric character."));
01117     }
01118     elseif (db_result(db_query("SELECT bpname FROM {og_blueprint} WHERE bpname = '%s' ORDER BY bpname DESC LIMIT 1", $form_values['bpvals']['bpname']))) {
01119       form_error($form['bpname'], t("That internal system name is already in use by another blueprint. Please choose another."));
01120     }
01121   }
01122 }

og_blueprints_blueprint_relink_confirm ( did  ) 

Definition at line 1144 of file og_blueprints.module.

01144                                                       {
01145   $blueprint = new og_blueprint_typed(array('did' => $did));
01146   $form['blueprint_data'] = array('#type' => 'value', '#value' => serialize($blueprint));
01147 
01148   return confirm_form($form,
01149   t('Are you sure you want to relink this bundle-specific blueprint %title back to master blueprint?', array('%title' => $blueprint->page_title)),
01150     $_REQUEST['destination'],
01151   t('Any layout, layout settings, or content customizations you have made since delinking this blueprint from the Master will be PERMANENTLY lost.'),
01152   t('Relink'), t('Cancel')
01153   );
01154 }

og_blueprints_blueprint_relink_confirm_submit ( form_id,
form_values 
)

Definition at line 1156 of file og_blueprints.module.

01156                                                                                {
01157   $blueprint = unserialize($form_values['blueprint_data']);
01158   $blueprint->relink();
01159   drupal_set_message("Blueprint successfully relinked with the default.");
01160 }

og_blueprints_bundle_removal_confirm_submit ( form_id,
form_values 
)

Definition at line 1425 of file og_blueprints.module.

01425                                                                              {
01426   list($bundle) = $form_values['og_blueprints_bundle'];
01427   $bundle->remove('delete', $form_values['blueprints_action']);
01428 }

og_blueprints_bundle_removal_form ( &$  form,
bundle 
)

Parameters:
$form 
object $bundle Instance of the og_bundle_type_remover class.

Definition at line 1396 of file og_blueprints.module.

01396                                                             {
01397   $form['#submit']['og_blueprints_bundle_removal_confirm_submit'] = array();
01398   $form['og_blueprints_bundle'] = array('#type' => 'value', '#value' => array($bundle));
01399   
01400   if (user_access('manage og blueprints')) {
01401     $options['retain'] = t('Remove the associated bundle, but retain the bundle version history. Since you are deleting this node type, the only use case is if you intend to create a new group node type to replace this one, and you want the new group node type to inherit the bundle version history from the old group node type. (Note that the UI facilitating this has not yet been implemented.)');
01402     $options['purge'] = t('Purge all data on the associated bundle from the database. Purging means removing all trace of the bundle from the database (i.e., deleting the entire version history). Consequently, you should select this option ONLY if you have no further need for that data.');
01403     // TODO need to figure out if there's a way to implement this that plays nicely with og itself...
01404     // $options['convert'] = t('As above, but mark the bundle & revision data for merging into an existing group type.');
01405     
01406     if ($bundle->release_id) { // TODO consider making this check more elaborate. ensure that NO changes have been made
01407       $form['blueprints_action'] = array(
01408         '#type' => 'radios',
01409         '#title' => t('Group Bundles (OG Blueprints)'),
01410         '#options' => $options,
01411         '#default_value' => 'retain',
01412         '#description' => t('Deleting this group will orphan the related OG Blueprints bundle data. Indicate how you want this orphaned data to be handled.'),
01413         '#weight' => 5,
01414       );
01415     }
01416     else {
01417       $form['blueprints_action'] = array('#type' => 'value', '#value' => 'purge');
01418     }
01419   }
01420   else {
01421     $form['blueprints_action'] = array('#type' => 'value', '#value' => 'retain');
01422   }  
01423 }

og_blueprints_bundlecfg_table ( type,
ismaster,
bundle 
)

Parameters:
string $type The group type for which the bundle settings are being edited.

Definition at line 808 of file og_blueprints.module.

00808                                                                   {
00809   $form['typevar'] = array('#type' => 'hidden', '#value' => $type);
00810   $form['#tree'] = TRUE;
00811   // TODO add a default tab as a means of allowing people to add/remove panel blueprints?
00812   foreach ($bundle->blueprints as $bpid => $blueprint) {
00813     $form[$bpid]['page_title'] = array('#value' => $blueprint->page_title .' (<em>'. $blueprint->bpname .'</em>)'); // TODO switch to 'description' font?
00814     $form[$bpid]['weight'] = array('#type' => 'weight', '#default_value' => $blueprint->weight ? $blueprint->weight : 0);
00815     $form[$bpid]['edit'] = array('#value' => l(t('Edit'), "admin/og/og_blueprints/blueprint/form/$bpid/$type", array(), drupal_get_destination()));
00816     $form[$bpid]['enabled'] = array('#type' => 'checkbox', '#default_value' => $blueprint->enabled);
00817     $form[$bpid]['show_blocks'] = array('#type' => 'checkbox', '#default_value' => $blueprint->show_blocks);
00818     $form[$bpid]['published'] = array('#type' => 'checkbox', '#default_value' => $blueprint->published);
00819     if ($ismaster) {
00820       $form[$bpid]['delete'] = array('#value' => l(t('Delete'), "admin/og/og_blueprints/blueprint/delete/$bpid", array(), drupal_get_destination()));
00821       if ($all_disabled = og_blueprints_mode() == 2) {
00822         $form[$bpid]['weight']['#disabled'] = TRUE;
00823         $form[$bpid]['enabled']['#disabled'] = TRUE;
00824         $form[$bpid]['published']['#disabled'] = TRUE;
00825         $form[$bpid]['show_blocks']['#disabled'] = TRUE;
00826       }
00827     }
00828 
00829     if ($blueprint->default_page == TRUE) {
00830       $default_page = $bpid;
00831     }
00832     $options[$bpid] = '';
00833   }
00834 
00835   // $options = $optionshome;
00836   // $optionshome[0] = t('<em>(Do not replace the group homepage with a blueprint)</em>');
00837   $form['default_page'] = array(
00838     '#type' => 'radios',
00839     '#options' => $options,
00840     '#default_value' => $default_page ? $default_page : 0, 
00841   );
00842   $form['submit'] = array(
00843     '#type' => 'submit',
00844     '#value' => t('Save Bundle'),
00845   );
00846   if ($all_disabled) {
00847     $form['default_page']['#disabled'] = TRUE;
00848     $form['submit']['#disabled'] = TRUE;
00849   }
00850   $form['bundle_data'] = array('#type' => 'hidden', '#value' => serialize($bundle));
00851   return $form;
00852 }

og_blueprints_bundlecfg_table_submit ( form_id,
form_values 
)

Definition at line 930 of file og_blueprints.module.

00930                                                                       {
00931   $bundle = unserialize($form_values['bundle_data']);
00932   foreach ($bundle->blueprints as $bpid => $blueprint) {
00933     $blueprint->default_page = $form_values['default_page'] == $bpid ? 1 : 0;
00934     list ($blueprint->weight, $blueprint->enabled, $blueprint->show_blocks, $blueprint->published) = array_values($form_values[$bpid]);
00935     $blueprint->save();
00936   }
00937   drupal_set_message(t("Successfully updated the '!type' bundle.", array('!type' => $form_values['typevar'])));
00938 }

og_blueprints_content_push (  ) 

Definition at line 1280 of file og_blueprints.module.

01280                                       {
01281   return t('This feature has not yet been implemented. Sorry. !projectlink out for it, it should be here by OG Blueprints Alpha2!', array('!projectlink' => l(t('Keep an eye'), 'http://drupal.org/project/og_blueprints')));
01282 }

og_blueprints_create_release ( grouptype  ) 

Definition at line 1253 of file og_blueprints.module.

01253                                                   {
01254   drupal_set_title(t('Create New Release'));
01255   $form['grouptype'] = array('#type' => 'value', '#value' => $grouptype);
01256   $form['release_name'] = array(
01257     '#title' => t('Release Name'),
01258     '#type' => 'textfield',
01259     '#description' => t('Name this release. This name will be public-facing (to group administrators), so pick something that will help them understand it.'),
01260     '#required' => TRUE,
01261   );
01262   $form['actions']['submit'] = array(
01263     '#type' => 'submit',
01264     '#value' => t('Create Release'),
01265   );
01266   
01267   $form['actions']['cancel'] = array('#value' => l(t('Cancel'), 'admin/og/og_blueprints/release'));
01268 
01269   $form['info'] = array(
01270     '#value' => t("<p>For now, you CANNOT delete a release once you've created it. Make sure you've double-checked your bundle and blueprint setups before proceeding!</p><p>Yep, this interface sucks. I know. Sorry. Signficantly more granular control and more detailed information is coming soon.</p>"),
01271   );
01272   return $form;
01273 }

og_blueprints_create_release_submit ( form_id,
form_values 
)

Definition at line 1275 of file og_blueprints.module.

01275                                                                      {
01276   $bundle = new og_bundle_new_release($form_values['grouptype'], $form_values['release_name']);
01277   drupal_set_message(t("A new release of " . ($bundle->bid == 1 ? 'your' : "the '$bundle->group_name'") . " bundle has been created. These blueprints will now be instantiated as OG Panels for all new " . ($blueprint->bid == 1 ? "groups." : "groups of that type.")));
01278 }

og_blueprints_form_alter ( form_id,
&$  form 
)

Definition at line 1367 of file og_blueprints.module.

01367                                                     {
01368   switch ($form_id) {
01369     case 'node_type_form':
01370       $form['#submit']['og_blueprints_og_node_type_form_submit'] = array();
01371       // Saving these is redundant, as other modules appear to save them too, but I'd rather not be dependent on a
01372       // minor detail in someone else's API that could easily & reasonably change without warning. Ehh...just gonna
01373       // trust them, and keep this here for easy testing if the API goes screwy. 
01374       // $form['og_blueprints_data'] = array('#type' => 'value', '#value' => array('old_type' => $form['type']['#value'], 'old_og_usage' => $form['og_content_type_usage']['#value']));
01375       break;
01376     case 'node_delete_confirm':
01377       $node = node_load($form['nid']['#value']);
01378       if (og_is_group_type($node->type)) {
01379         $bundle = new og_bundle_type_remover($node->type);
01380         og_blueprints_bundle_removal_form($form, $bundle);
01381       }
01382       break;
01383   }
01384 }

og_blueprints_group_types ( master = FALSE  ) 

Because of the omnipresent 'Master' bundle, it's sometimes helpful to add a 'Master' value to the beginning of this array. That's what the first parameter is for.

Parameters:
boolean $master = FALSE indicates whether a 'master' group type should be added at the beginning of the array.
Returns:
array $group_types An associative array of the form [system_type_name] => [public-facing_type_name] for all group types. Also can return FALSE if no groups have been defined.

Definition at line 748 of file og_blueprints.module.

00748                                                     {
00749   if ($group_types = variable_get('og_node_types', array())) {
00750     asort($group_types);
00751     foreach ($group_types as $type) {
00752       $group_types[$type] = node_get_types('name', $type);
00753     }
00754     if ($master) {
00755       $group_types = array_merge(array('master' => 'Master'), $group_types);
00756     }
00757   }
00758   return $group_types;
00759 }

og_blueprints_help ( section  ) 

Definition at line 568 of file og_blueprints.module.

00568                                       {
00569   switch ($section) {
00570     case 'admin/help#og_blueprints': // TODO write up quite a
00571     $output = t('<em>NOTE: This section was slapped together quickly, and will be improved later. It works for now, and there needed to be a release of the module.</em>'); // FIXME move into help text
00572   }
00573 }

og_blueprints_list ( refresh = FALSE  ) 

Parameters:
bool $refresh The list is cached using a static var, and will only be refreshed from the variables table if explicitly told to do so
Returns:
array $blueprints Returns an empty array if no blueprints have been defined

Definition at line 769 of file og_blueprints.module.

00769                                               {
00770   static $blueprints;
00771   if (empty($blueprints) || $refresh) {
00772     if ($refresh || !$blueprints = variable_get('og_blueprints_list', FALSE)) {
00773       $blueprints = array();
00774       $result = db_query("SELECT DISTINCT bpid, bpname FROM {og_blueprint}");
00775       while ($row = db_fetch_array($result)) {
00776         $blueprints[$row['bpid']] = $row['bpname'];
00777       }
00778       variable_set('og_blueprints_list', $blueprints);
00779     }
00780   }
00781   return $blueprints;
00782 }

og_blueprints_menu ( may_cache  ) 

Definition at line 578 of file og_blueprints.module.

00578                                         {
00579   $group_types = og_blueprints_group_types();
00580   $bundle_mode = og_blueprints_mode();
00581   if ($may_cache) {
00582     $items[] = array(
00583       'path' => 'admin/og/og_blueprints',
00584       'title' => t('Organic Groups Blueprints'),
00585       'description' => t("Configure OG Blueprints' operating mode regarding bundles and group types."),
00586       'callback' => 'drupal_get_form',
00587       'callback arguments' => array('og_blueprints_admin'),
00588       'access' => user_access('manage og blueprints'),
00589       'weight' => 0,
00590     );
00591     $items[] = array(
00592       'title' => t("Operating Mode"),
00593       'description' => t("Configure OG Blueprints' operating mode regarding bundles and group types."),
00594       'path' => 'admin/og/og_blueprints/settings',
00595       'type' => MENU_DEFAULT_LOCAL_TASK,
00596       'weight' => -10,
00597     );
00598     if ($group_types && $bundle_mode) { // at least one group type must have already been set, and bundles must be enabled
00599       $multi = $bundle_mode == 1 ? FALSE : TRUE;
00600       $items[] = array(
00601         'path' => 'admin/og/og_blueprints/release',
00602         'title' => t('Releases'),
00603         'description' => t("Manage your bundle releases"),
00604         'callback' => 'og_blueprints_release_overview',
00605         'type' => MENU_LOCAL_TASK,
00606         'access' => user_access('manage og blueprints'),
00607         'weight' => -4,
00608       );
00609       $items[] = array(
00610         'path' => 'admin/og/og_blueprints/release/overview',
00611         'title' => t('Releases Overview'),
00612         'type' => MENU_DEFAULT_LOCAL_TASK,
00613         'access' => user_access('manage og blueprints'),
00614         'weight' => -10,
00615       );
00616       $items[] = array(
00617         'path' => 'admin/og/og_blueprints/release/create',
00618         'callback' => 'drupal_get_form',
00619         'callback arguments' => array('og_blueprints_create_release'),
00620         'type' => MENU_CALLBACK,
00621       );
00622       $items[] = array(
00623         'path' => 'admin/og/og_blueprints/release/push',
00624         'title' => t('Push Blueprint Content'),
00625         'description' => t('Selectively push content from your blueprints into existing groups.'),
00626         'callback' => 'og_blueprints_content_push',
00627         'type' => MENU_LOCAL_TASK,
00628         'weight' => -8,
00629       );
00630       $items[] = array(
00631         'path' => 'admin/og/og_blueprints/newbp',
00632         'title' => t('New Blueprint'),
00633         'description' => t('Add a new OG Blueprint to '. $multi ? 'your group bundle' : 'each of your group bundles'),
00634         'callback' => 'drupal_get_form',
00635         'callback arguments' => array('og_blueprints_blueprint_form', 0),
00636         'type' => MENU_LOCAL_TASK,
00637         'access' => user_access('manage og blueprints'),
00638         'weight' => 0,
00639       );
00640       $items[] = array(
00641         'path' => 'admin/og/og_blueprints/bundlecfg',
00642         'title' => t('Bundles'),
00643         'description' => t('Select which blueprints are to be used ' . $multi ? 'for each of your group type bundles.' : 'in your group bundle.'),
00644         'callback' => 'og_blueprints_admin_bundlecfg',
00645         'type' => MENU_LOCAL_TASK,
00646         'access' => user_access('manage og blueprints'),
00647         'weight' => -8,
00648       );
00649       $items[] = array(
00650         'path' => 'admin/og/og_blueprints/blueprintsetup',
00651         'title' => t('Blueprints'),
00652         'description' => t('Configure the panel blueprints that make up your bundle.'),
00653         'callback' => 'og_blueprints_admin_blueprintsetup',
00654         'callback arguments' => array('master'),
00655         'type' => MENU_LOCAL_TASK,
00656         'access' => user_access('manage og blueprints'),
00657         'weight' => -6,
00658       );      
00659       if ($bundle_mode == 2) {
00660         $items[] = array(
00661           'path' => 'admin/og/og_blueprints/bundlecfg/master',
00662           'title' => t('(Master Bundle)'),
00663           'type' => MENU_DEFAULT_LOCAL_TASK,
00664           'access' => user_access('manage og blueprints'),
00665         );
00666         $items[] = array(
00667           'path' => 'admin/og/og_blueprints/blueprintsetup/master',
00668           'title' => t('(Master Bundle)'),
00669           'description' => t('Configure the panels that make up your bundle.'),
00670           'type' => MENU_DEFAULT_LOCAL_TASK,
00671           'access' => user_access('manage og blueprints'),
00672         );        
00673         $i = 1;
00674         foreach ($group_types as $type => $name) {
00675           $items[] = array(
00676             'path' => 'admin/og/og_blueprints/bundlecfg/'. $type,
00677             'title' => t($name),
00678             'callback' => 'og_blueprints_admin_bundlecfg',
00679             'callback arguments' => array($type),
00680             'type' => MENU_LOCAL_TASK,
00681             'access' => user_access('manage og blueprints'),
00682             'weight' => $i,
00683           );
00684           $items[] = array(
00685             'path' => 'admin/og/og_blueprints/blueprintsetup/'. $type,
00686             'title' => t($name),
00687             'callback' => 'og_blueprints_admin_blueprintsetup',
00688             'callback arguments' => array($type),
00689             'type' => MENU_LOCAL_TASK,
00690             'access' => user_access('manage og blueprints'),
00691             'weight' => $i,
00692           );          
00693           $i++;
00694         }
00695       }
00696       $items[] = array(
00697         'path' => 'admin/og/og_blueprints/blueprint/form',
00698         'callback' => 'drupal_get_form',
00699         'callback arguments' => array('og_blueprints_blueprint_form'),
00700         'type' => MENU_CALLBACK,
00701         'access' => user_access('manage og blueprints'),
00702       );
00703       $items[] = array(
00704         'path' => 'admin/og/og_blueprints/blueprint/edit',
00705         'callback' => 'og_blueprints_blueprint_edit',
00706         'type' => MENU_CALLBACK,
00707         'access' => user_access('manage og blueprints'),
00708       );
00709       $items[] = array(
00710         'path' => 'admin/og/og_blueprints/blueprint/delete',
00711         'callback' => 'drupal_get_form',
00712         'callback arguments' => array('og_blueprints_blueprint_delete_confirm'),
00713         'type' => MENU_CALLBACK,
00714         'access' => user_access('manage og blueprints'),
00715       );
00716       $items[] = array(
00717         'path' => 'admin/og/og_blueprints/blueprint/relink',
00718         'callback' => 'drupal_get_form',
00719         'callback arguments' => array('og_blueprints_blueprint_relink_confirm'),
00720         'type' => MENU_CALLBACK,
00721         'access' => user_access('manage og blueprints'),
00722       );
00723     }
00724   }
00725   return $items;
00726 }

og_blueprints_mode ( new_setting = NULL  ) 

Definition at line 1466 of file og_blueprints.module.

01466                                                  {
01467   static $mode;
01468   if (!isset($mode)) {
01469     $mode = variable_get('og_blueprints_mode', 0);
01470   }
01471   if (!is_null($new_setting)) {
01472     variable_set('og_blueprints_mode', $new_setting);
01473     $mode = $new_setting;
01474   }
01475   return $mode;
01476 }

og_blueprints_nodeapi ( &$  node,
op,
a3 = NULL,
a4 = NULL 
)

og_blueprints uses nodeapi to trigger the automated duplication of blueprint bundles into actual og panels whenever a group of the appropriate type is created.

// TODO consider switching to workflow_ng for this

$function = '_og_blueprints_' . $form_id; if (function_exists($function)) { $ret = call_user_func_array($func, $args); }

Definition at line 1355 of file og_blueprints.module.

01355                                                                     { // TODO add hook here to check for updates
01356   if ($op == 'insert' && $bundle_mode = og_blueprints_mode()) {
01357     if (in_array($group_type = $node->type, array_keys(og_blueprints_group_types()))) {
01358       $bundle = new og_bundle_instantiator($nid = $node->nid, $group_type);
01359       $bundle->instantiate();
01360     }
01361   }
01362 }

og_blueprints_og_node_type_form_submit ( form_id,
form_values 
)

Definition at line 1430 of file og_blueprints.module.

01430                                                                         {
01431   // keeping this line for easy testing reference, in case the API suddenly goes inexplicably screwy
01432   // array($form_values['og_blueprints_data']['old_type'], $form_values['og_blueprints_data']['old_og_usage']);
01433   list($old_type, $type, $old_og_usage, $og_usage) = array($form_values['old_type'], $form_values['type'], $form_values['old_og_content_type_usage'], $form_values['og_content_type_usage']);
01434   
01435   // has to be done first to ensure that group_type is accurate for later functions
01436   if ($old_type != $type) {
01437     $orphaned_bids = variable_get('og_blueprints_orphaned_bids', array());
01438     // harmless to run UPDATE if there's value in the {og_bundle} table with this value, so no
01439     // need to conditionalize it
01440     db_query("UPDATE {og_bundle} SET grouptype = '%s' WHERE grouptype = '%s'", $type, $old_type);
01441     // serious edge case, but updates the holdover variable if the type name is being changed
01442     // JUST IN CASE they re-activate it later
01443     if (isset($orphaned_bids[$old_type])) {
01444       $orphaned_bids[$type] = $orphaned_bids[$old_type];
01445       unset ($orphaned_bids[$old_type]);
01446       variable_set('og_blueprints_orphaned_bids', $orphaned_bids);
01447     }
01448   }
01449   
01450   if ($old_og_usage != $og_usage) {
01451     if ($old_og_usage == 'group') {
01452       $action = new og_bundle_type_remover($type);
01453       $action->remove('unset_as_group', 'retain');
01454       if (user_access('manage og blueprints')) { // TODO need to investigate how my versioning system handles these 'disabled' bundles
01455         drupal_set_message(t('By unmarking this node type as an OG group type, you have orphaned the OG Blueprints bundle data associated with this type. If you make this node type into a group again later, the bundle data will be automatically restored.'));
01456       }
01457     }
01458     elseif ($og_usage == 'group') {
01459       $action = new og_bundle_type_creator($type);
01460       $action->create();
01461     }
01462   }
01463   cache_clear_all('*', 'cache_menu', TRUE);
01464 }

og_blueprints_perm (  ) 

Definition at line 732 of file og_blueprints.module.

00732                               {
00733   return array('manage og blueprints');
00734 }

og_blueprints_query_fields ( passed = NULL  ) 

Automatically update admin preferences when node type is renamed or removed. NOTE: copied from og, just keeping it here temporarily. update it when you can. function og_blueprints_node_type($op, $info) { $node_type_variables = array('og_omitted_email_node_types', 'og_omitted', 'og_node_types'); foreach ($node_type_variables as $variable) { $values = variable_get($variable, array()); switch ($op) { case 'delete': if (in_array($info->old_type, $values)) { unset($values[array_search($info->old_type, $values)]); variable_set($variable, $values); } break; case 'update': if (!empty($info->old_type) && $info->old_type != $info->type) { if (in_array($info->old_type, $values)) { $values[array_search($info->old_type, $values)] = $info->type; variable_set($variable, $values); } } break; } } }

Definition at line 1505 of file og_blueprints.module.

01505                                                     {
01506   $fieldlist = array(
01507     "nid" => '%d',
01508     "grouptype" => "'%s'",
01509     "bid" => '%d',
01510     "vid" => '%d',
01511     'release_id' => '%d',
01512     'release_name' => "'%s'",
01513     "bpid" => '%d',
01514     "bpname" => "'%s'",
01515     "did" => "%d",
01516     "linked" => '%d',
01517     "enabled" => '%d',
01518     "published" => "%d",
01519     "default_page" => "%d",
01520     "page_title" => "'%s'",
01521     "path" => "'%s'",
01522     "show_blocks" => "%d",
01523     "weight" => "%d",
01524   );
01525   if (!is_null($passed)) {
01526     return array_intersect_key($fieldlist, array_flip($passed));
01527   }
01528   else return $fieldlist;
01529 }

og_blueprints_release_overview (  ) 

Definition at line 1232 of file og_blueprints.module.

01232                                           {
01233   // $dashboard_help = new og_blueprints_help('dashboard');
01234   //$output = $dashboard_help->help('helptext', arg(3), FALSE);
01235   $operator = ($bundle_mode = og_blueprints_mode()) == 2 ? '<>' : '=';
01236   $release_data = db_query("SELECT * FROM {og_bundle} WHERE bid $operator 1");
01237   $group_types = og_blueprints_group_types(TRUE);
01238   
01239   $rows = array();
01240   while ($data = db_fetch_array($release_data)) {
01241     $rid = !empty($data['release_id']) ? $data['release_id'] : 0;
01242     $group_type = array_shift($data);
01243     $row['group name'] = $group_types[$group_type];
01244     $row['current release'] = $rid ? "No. $rid - " . db_result(db_query("SELECT release_name FROM {og_bundle_revision} WHERE bid = %d AND release_id = %d", $data['bid'], isset($rid) ? $rid : 0)) : 'No Releases';
01245     $row['time since'] = $rid ? format_interval(time() - db_result(db_query("SELECT timestamp FROM {og_bundle_revision} WHERE bid = %d AND release_id = %d", $data['bid'], $rid))) : '';
01246     $row['new release link'] = l(t('Create Bundle Release'), 'admin/og/og_blueprints/release/create/' . $group_type, array(), drupal_get_destination());
01247     $rows[$group_type] = $row;
01248   }
01249   $header = array('Group Type', 'Active Release', 'Last Release', '');
01250   return $output . theme('table', $header, $rows);  
01251 }

og_blueprints_sort_bundle ( a,
b 
)

Sorts a given bundle's blueprints by the following criteria: 1. Default Page status 2. Whether the blueprint is enabled or disabled in the bundle 3. Finally, by weight

Definition at line 909 of file og_blueprints.module.

00909                                            {
00910   if ($b->default_page) {
00911     return TRUE;
00912   }
00913   elseif ($a->default_page) {
00914     return FALSE;
00915   }
00916 
00917   $active = $b->enabled - $a->enabled;
00918   if ($active) {
00919     return $active;
00920   }
00921 
00922   // if ($a['active']) return ($a['weight'] - $b['weight']);
00923   return ($a->weight - $b->weight);
00924 }

og_blueprints_sync_bundles_with_node_types (  ) 

Built-in protection against duplicate entries in the og_bundle_type_creator object means we can be sloppy and simply add all group types - duplicates will be automatically and harmlessly filtered out.

See also:
og_bundle_type_creator::create()

Definition at line 1332 of file og_blueprints.module.

01332                                                       {
01333   foreach (array_keys(og_blueprints_group_types()) as $new_type) {
01334     $action = new og_bundle_type_creator($new_type);
01335     $action->create();
01336   }
01337   cache_clear_all('*', 'cache_menu', TRUE);
01338 }

theme_og_blueprints_admin_dashboard ( bundle  ) 

Parameters:
$bundle instanceof og_bundle subclass A fully-loaded
Returns:
string

Definition at line 896 of file og_blueprints.module.

00896                                                       {
00897   drupal_add_css(drupal_get_path('module', 'og_blueprints') . '/og_blueprints_admin.css');
00898   $help = new og_blueprints_help('dashboard');
00899   $output = '<div class="clear-block"><div id="og-blueprints-admin-helptext">' . $help->help('inline', arg(3), $bundle) . '</div>';
00900   return $output . '<div id="og-blueprint-dashboard">' . theme('table', array(array('data' => t('Bundle Releases'), 'colspan' => 4)), array($bundle->dashboard()), array('class' => 'og-blueprint-admin-table'), $help->help('caption', arg(3), $bundle)) . "</div></div>";
00901 }

theme_og_blueprints_bundlecfg_table ( form  ) 

Definition at line 859 of file og_blueprints.module.

00859                                                     {
00860   $ismaster = $form['typevar']['#value'] == 'master' ? TRUE : FALSE;
00861   $bundle = unserialize($form['bundle_data']['#value']);
00862   foreach (array_intersect(element_children($form), array_keys($bundle->blueprints)) as $bpid) {
00863     $row = array(
00864     drupal_render($form[$bpid]['page_title']),
00865     drupal_render($form['default_page'][$bpid]),
00866     drupal_render($form[$bpid]['enabled']),
00867     drupal_render($form[$bpid]['published']),
00868     drupal_render($form[$bpid]['show_blocks']),
00869     drupal_render($form[$bpid]['weight']),
00870     drupal_render($form[$bpid]['edit']),
00871     );
00872     if ($ismaster) {
00873       $row[] = drupal_render($form[$bpid]['delete']);
00874     }
00875     $rows[] = $row;
00876     unset($row);
00877   }
00878   
00879   
00880   $help = new og_blueprints_help('mainform');
00881   $header = array(t('Blueprint'), t('Home Page'), t('Enabled'), t('Published'), t('Show Blocks'), t('Weight'), array('data' => t('Operations'), 'align' => 'center', 'colspan' => $ismaster ? 2 : 1));
00882   $output .= theme('table', $header, $rows, array('class' => 'og-blueprint-admin-table'), $help->help('caption', arg(3), $bundle));
00883   $output .= drupal_render($form);
00884   return $output;
00885 }


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