/[drupal]/contributions/modules/og_blueprints/helptext.inc
ViewVC logotype

Contents of /contributions/modules/og_blueprints/helptext.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Apr 17 21:17:25 2008 UTC (19 months, 1 week ago) by sdboyer
Branch: MAIN
CVS Tags: DRUPAL-5--1-0-ALPHA1, DRUPAL-5--1-0-ALPHA3, DRUPAL-5--1-0-ALPHA2, HEAD
Branch point for: DRUPAL-5
Changes since 1.1: +127 -4 lines
File MIME type: text/x-php
ready for alpha1 release
1 <?php
2 // $Id: helptext.inc,v 1.1 2008/04/15 03:28:11 sdboyer Exp $
3
4 /**
5 * @file helptext.inc
6 *
7 * Include file specifically containing the vast swathes of inline
8 * help messages that blueprints employs to make the process more intelligible
9 *
10 * Function naming structure is as follows for inline text:
11 *
12 * "ogbp_help_" + (section) + "_" + (item/group)
13 *
14 * And for hook_help()-based help messages:
15 *
16 * "ogbp_helphook_" + (section) + "_" + (item/group)
17 */
18
19 function ogbp_help_dashboard_inline(&$t_args, $location, $bundle, $args = array()) {
20 if ($location == 'bundlecfg') {
21 list($help_text[2][], $help_text[1][], $help_text[0][]) = array_fill(0, 3, "This table allows you to change those blueprint settings that are not connected to the blueprint's panel configuration. For more thorough explanations of each setting, see the corresponding !bundlesettings.");
22 list($t_args[2]['!bundlesettings'], $t_args[1]['!bundlesettings'], $t_args[0]['!bundlesettings']) = array_fill(0, 3, l(t('help page'), 'help...')); // FIXME finish/figure it out
23
24 $help_text[1][] = "However, because you are viewing the Master bundle in 'Bundles Per Group Type' mode, almost all of the widgets for these settings are disabled, as these Master values are neither used nor referenced in this mode. A more detailed explanation of the logic behind this behavior can be found !masterlogic.";
25 $t_args[1]['!masterlogic'] = l(t('in the documentation'), 'help...'); // FIXME finish/figure it out
26 $help_text[1][] = "The only unique functionality on this page is deleting blueprints. Please note, however, that deleting a blueprint here will delete that blueprint for <strong>ALL</strong> your bundles. If you don't want a blueprint to be instantiated with a particular group type, you should simply <em>disable</em> it in that bundle's settings.";
27
28 $help_text[2][] = "Every setting visible on this page, as well as every setting on the add/edit blueprint editing form (accessible via the 'Edit' links in the table) are specific to this bundle ONLY. They are completely unrelated to linking.";
29 $t_args[2]['!editblueprints'] = '';
30 }
31 elseif ($location == 'blueprintsetup') {
32 list($help_text[2][], $help_text[1][], $help_text[0][]) = array_fill(0, 3, "Use the links in the table below to edit the panels settings - content, layout, and layout settings - for the blueprints that comprise your bundle.");
33
34 $help_text[1][] = "You're editing the Master bundle right now, so your changes will 'propogate' to all the other bundles' blueprints that are linked to the master. The number of blueprints still linked is listed in the 'Linked Blueprints' column; a meager UI offering, but more features are on the way soon. You can also learn more about the the Blueprints linking system works in the !linking (soon!).";
35 $help_text[2][] = "Because you are editing a type-specific bundle with OG Blueprints in Bundle Per Type mode, you have to think about blueprint linking. The !linking has a more detailed explanation, but the essentials are these: all you have to do delink a blueprint is go into one of the panels editors (via the links below) and save some changes; as the messages will tell you, the delinking process ONLY begins once you've clicked 'Save.'";
36 $help_text[2][] = "While you can relink the blueprint to the Master at any time, doing so too much could prove be disruptive to your users. Linking and delinking a blueprint back and forth from one release to the next can easily result a plethora of confusing update messages for your group admins.";
37 $t_args[1]['!linking'] = $t_args[2]['!linking'] = '';
38 }
39 elseif ($location = 'mode') {
40 list($help_text[1][], $help_text[0][], $help_text[-1][]) = array_fill(0, 3, "Group 'blueprints' are bundles of panels and administrative settings, encompassing all the options a group administrator is able to manually set for their own group using OG Panels. Rather than applying to just one group, however, these bundles & blueprints are defined by group <em>type</em>. The blueprints get instantiated as actual OG Panels when new groups get created.");
41 $help_text[-1][] = "OG Blueprints allows varying levels of granularity in configuring these blueprints. However, bundles are currently disabled. Select one of the 'Enabled' settings below to begin bundles. <ul><li>Selecting 'Enabled - One Bundle' will cause ALL of your group types to use the same bundle.</li><li>Selecting 'Enabled - Bundles Per Type' will allow you to create bundles for each group type you have defined in !ogadmin.</li></ul>";
42 $t_args[-1]['!ogadmin'] = $t_args[0]['!ogadmin'] = '';
43 $help_text[0][] = "OG Blueprints is currently operating in 'One Bundle' mode, which means the blueprints in the bundle you define will apply to ALL the node types you define as groups in !ogadmin.";
44 $help_text[0][] = "You can switch to 'Bundles Per Type' mode without losing any of your settings. If you disable OG Blueprints, your configuration will be exactly the same when it is re-enabled.";
45 $help_text[1][] = "OG Blueprints is currently operating in 'Bundles Per Type' mode. This mode is quite complex, and it's recommended that you spend some time familiarizing yourself with the !linking (available soon) before you start making releases.";
46 $t_args[1]['!linking'] = '';
47 $help_text[1][] = "<strong>WARNING:</strong> Switching back to 'One Bundle' has not yet been thoroughly tested, and there is consequently the potential that some of your type-specific bundles & blueprints could be altered or destroyed if you switch back. However, there is no risk of damaging your data UNTIL you make a release in this mode.";
48 $help_text[1][] = "It is the module developer's recommendation that, if you have any thoughts that you might like to have different blueprints for different group types at any time, you operate in 'Bundles Per Type' mode from the very beginning.";
49 }
50 return _ogbp_finish($help_text, $t_args);
51 }
52
53
54 function ogbp_help_dashboard_caption(&$t_args, $location, $bundle, $args = array()) {
55 $text = '<strong>PLEASE NOTE:</strong> Until you create a release for this bundle, it will be inactive - your blueprints will NOT be instantiated as OG Panels when a ';
56 if (empty($bundle->release_id)) {
57 $help_text[0][] = $text . 'group is created.';
58 $help_text[2][] = $text . "'$bundle->grouptype' group is created.";
59 }
60 else {
61 $help_text[0][] = $help_text[2][] = '';
62 }
63 $help_text[1][] = "You cannot create releases of the Master bundle in 'Bundle-Per-Type' mode. Only releases of the type-specific bundles can be created.";
64 return _ogbp_finish($help_text, $t_args);
65 }
66
67 function ogbp_help_mainform_caption(&$t_args, $location, $bundle, $args = array()) {
68 if ($location == 'blueprintsetup') {
69 $help_text[0][] = 'Disabled blueprints can be re-enabled in the !bundlecfg menu.';
70 $t_args[0]['bundlecfg'] = '';
71 $help_text[1][] = "<strong>Reminder:</strong> when you edit Master blueprints, you're changing those values for ALL of the blueprints that are still linked to the Master!";
72 $help_text[2][] = "Never worry about delinking a blueprint from the Master blueprint - it's easily reversed, and nothing is deleted. Relinking, however, <strong>is</strong> a destructive process: the delinked display of the blueprint is deleted from the database, and can only be recovered if you have a !backuplink" . ".";
73 $t_args[2]['!backuplink'] = l(t('backup of your database'), 'http://drupal.org/project/backup_migrate');
74 }
75 elseif ($location == 'bundlecfg') {
76 $help_text[0][] = "Keep in mind that these settings are only defaults! Once the blueprints are instantiated as og panels for a group, that group's' administrators will be as free to change these settings as the rest of their permissions allow.";
77 $help_text[1][] = "The options in this field are disabled because each group type defines its own Bundle settings in Bundles-Per-Type mode, completely independent of the Master.";
78 $help_text[2][] = "If you absolutely must delete a blueprint, then you'll have to go to the Master !bundlecfg to do it.";
79 $t_args[2]['!bundlecfg'] = '';
80 }
81 return _ogbp_finish($help_text, $t_args);
82 }
83
84 function ogbp_help_mode_submit(&$t_args, $location, $bundle, $args = array()) {
85 $help_text[-1][] = "Group Blueprints have been disabled. Any blueprints you have created will be accessible if you reactivate Group Blueprints.";
86 $help_text[0][] = "Group Blueprints have been enabled, using one bundle for all group types. You can configure your bundle in !bundlecfg.";
87 $help_text[1][] = "Group Blueprints have been enabled with one bundle per group type. You can configure all of your bundles in !bundlecfg.";
88 $t_args[0]['!bundlecfg'] = $t_args[1]['!bundlecfg'] = '';
89 return _ogbp_finish($help_text, $t_args);
90 }
91 /**
92 * &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
93 * HELPER FUNCTIONS
94 */
95
96 /**
97 * Defines a commonly used set of links. Intended to be called
98 * as the second argument in an array_merge.
99 */
100 function _ogbp_full_links() {
101 return $fullinks = array(
102 '!editblueprints' => l(t('Edit Blueprints'), 'admin/og/og_blueprints/blueprintsetup'),
103 '!bundlecfg' => l(t('Bundle Settings'), 'admin/og/og_blueprints/bundlecfg'),
104 '!linking' => l(t('linking documentation'), ''),
105 '!ogadmin' => l(t('Organic Groups Configuration'), 'admin/og/og'),
106 );
107 }
108
109 function _ogbp_finish($help_text, &$t_args) {
110 foreach ($help_text as $op => $help_items) { // ensures we keep the top-level array separate from the recursion.
111 $help_text[$op] = _wrap(implode('</p><p>', $help_items));
112 }
113 $full_links = _ogbp_full_links();
114 if (!empty($t_args)) {
115 foreach ($t_args as $key => $links) {
116 $t_args[$key] = array_merge($links, array_intersect_key($full_links, $links));
117 }
118 }
119 else $t_args = array();
120 return $help_text;
121 }
122
123 /**
124 * Simply wraps the string with a particular HTML tag. Defaults
125 * to <p>
126 */
127 function _wrap($string, $tag = 'p') {
128 return "<$tag>" . $string . "</$tag>";
129 }

  ViewVC Help
Powered by ViewVC 1.1.2