By TravisCarden: Made checklist progress bar update dynamically.
[project/checklistapi.git] / checklistapi_example / checklistapi_example.module
1 <?php
2
3 /**
4 * @file
5 * An example implementation of the Checklist API.
6 */
7
8 /**
9 * Implements hook_checklistapi_checklist_info().
10 *
11 * Defines a checklist based on
12 * @link http://buytaert.net/drupal-learning-curve Dries Buytaert's Drupal learning curve @endlink
13 * .
14 */
15 function checklistapi_example_checklistapi_checklist_info() {
16 $definitions = array();
17 $definitions['example_checklist'] = array(
18 '#title' => t('Checklist API example'),
19 '#path' => 'admin/config/development/checklistapi-example',
20 '#description' => t('An example implementation of the Checklist API.'),
21 '#help' => t('<p>This checklist based on <a href="http://buytaert.net/drupal-learning-curve">Dries Buytaert\'s Drupal learning curve</a> is an example implementation of the <a href="http://drupal.org/project/checklistapi">Checklist API</a>.</p>'),
22 'i_suck' => array(
23 '#title' => t('I suck'),
24 '#description' => t('<p>Gain these skills to pass the <em><a href="http://headrush.typepad.com/creating_passionate_users/2005/10/getting_users_p.html">suck threshold</a></em> and start being creative with Drupal.</p>'),
25 'install_configure' => array(
26 '#title' => t('Installation and configuration of Drupal core'),
27 '#description' => t('Prepare for installation, run the installation script, and take the steps that should be done after the installation script has completed.'),
28 'handbook_page' => array(
29 '#text' => t('Installation Guide'),
30 '#path' => 'http://drupal.org/documentation/install',
31 ),
32 ),
33 'node_system' => array(
34 '#title' => t('Node system'),
35 '#description' => t('Perform a variety of operations on one or more nodes.'),
36 'handbook_page' => array(
37 '#text' => t('Manage nodes'),
38 '#path' => 'http://drupal.org/node/306808',
39 ),
40 ),
41 'block_system' => array(
42 '#title' => t('Block system'),
43 '#description' => t('Create blocks and adjust their appearance, shape, size and position.'),
44 'handbook_page' => array(
45 '#text' => t('Working with blocks (content in regions)'),
46 '#path' => 'http://drupal.org/documentation/modules/block',
47 ),
48 ),
49 'users' => array(
50 '#title' => t('Users, roles and permissions'),
51 '#description' => t('Create and manage users and access control.'),
52 'handbook_page' => array(
53 '#text' => t('Managing users'),
54 '#path' => 'http://drupal.org/node/627158',
55 ),
56 ),
57 'contrib' => array(
58 '#title' => t('Installing contributed themes and modules'),
59 '#description' => t('Customize Drupal to your tastes by adding modules and themes.'),
60 'handbook_page' => array(
61 '#text' => t('Installing modules and themes'),
62 '#path' => 'http://drupal.org/documentation/install/modules-themes',
63 ),
64 ),
65 ),
66 'i_get_by' => array(
67 '#title' => t('I get by'),
68 '#description' => t('<p>Gain these skills to pass the <em><a href="http://headrush.typepad.com/creating_passionate_users/2005/10/getting_users_p.html">passion threshold</a></em> and start kicking butt with Drupal.</p>'),
69 'upgrade_patch_monitor' => array(
70 '#title' => t('Upgrading, patching, (security) monitoring'),
71 'handbook_page_upgrading' => array(
72 '#text' => t('Upgrading from previous versions'),
73 '#path' => 'http://drupal.org/upgrade',
74 ),
75 'handbook_page_patching' => array(
76 '#text' => t('Applying patches'),
77 '#path' => 'http://drupal.org/patch/apply',
78 ),
79 'security_advisories' => array(
80 '#text' => t('Security advisories'),
81 '#path' => 'http://drupal.org/security',
82 ),
83 'handbook_page_monitoring' => array(
84 '#text' => t('Monitoring a site'),
85 '#path' => 'http://drupal.org/node/627162',
86 ),
87 ),
88 'navigation_menus_taxonomy' => array(
89 '#title' => t('Navigation, menus, taxonomy'),
90 'handbook_page_menus' => array(
91 '#text' => t('Working with Menus'),
92 '#path' => 'http://drupal.org/documentation/modules/menu',
93 ),
94 'handbook_page_taxonomy' => array(
95 '#text' => t('Organizing content with taxonomy'),
96 '#path' => 'http://drupal.org/documentation/modules/taxonomy',
97 ),
98 ),
99 'locale_i18n' => array(
100 '#title' => t('Locale and internationalization'),
101 'handbook_page' => array(
102 '#text' => t('Multilingual Guide'),
103 '#path' => 'http://drupal.org/documentation/multilingual',
104 ),
105 ),
106 'customize_front_page' => array(
107 '#title' => t('Drastically customize front page'),
108 'handbook_page' => array(
109 '#text' => t('Totally customize the LOOK of your front page'),
110 '#path' => 'http://drupal.org/node/317461',
111 ),
112 ),
113 'theme_modification' => array(
114 '#title' => t('Theme and template modifications'),
115 'handbook_page' => array(
116 '#text' => t('Theming Guide'),
117 '#path' => 'http://drupal.org/documentation/theme',
118 ),
119 ),
120 ),
121 'i_kick_butt' => array(
122 '#title' => t('I kick butt'),
123 'contribute_docs_support' => array(
124 '#title' => t('Contributing documentation and support'),
125 'handbook_page_docs' => array(
126 '#text' => t('Contribute to documentation'),
127 '#path' => 'http://drupal.org/contribute/documentation',
128 ),
129 'handbook_page_support' => array(
130 '#text' => t('Provide online support'),
131 '#path' => 'http://drupal.org/contribute/support',
132 ),
133 ),
134 'content_types_views' => array(
135 '#title' => t('Content types and views'),
136 'handbook_page_content_types' => array(
137 '#text' => t('Working with nodes, content types and fields'),
138 '#path' => 'http://drupal.org/node/717120',
139 ),
140 'handbook_page_views' => array(
141 '#text' => t('Working with Views'),
142 '#path' => 'http://drupal.org/documentation/modules/views',
143 ),
144 ),
145 'actions_workflows' => array(
146 '#title' => t('Actions and workflows'),
147 'handbook_page' => array(
148 '#text' => t('Actions and Workflows'),
149 '#path' => 'http://drupal.org/node/924538',
150 ),
151 ),
152 'development' => array(
153 '#title' => t('Theme and module development'),
154 'handbook_page_theming' => array(
155 '#text' => t('Theming Guide'),
156 '#path' => 'http://drupal.org/documentation/theme',
157 ),
158 'handbook_page_development' => array(
159 '#text' => t('Develop for Drupal'),
160 '#path' => 'http://drupal.org/documentation/develop',
161 ),
162 ),
163 'advanced_tasks' => array(
164 '#title' => t('jQuery, Form API, security audits, performance tuning'),
165 'handbook_page_jquery' => array(
166 '#text' => t('JavaScript and jQuery'),
167 '#path' => 'http://drupal.org/node/171213',
168 ),
169 'handbook_page_form_api' => array(
170 '#text' => t('Form API'),
171 '#path' => 'http://drupal.org/node/37775',
172 ),
173 'handbook_page_security' => array(
174 '#text' => t('Securing your site'),
175 '#path' => 'http://drupal.org/security/secure-configuration',
176 ),
177 'handbook_page_performance' => array(
178 '#text' => t('Managing site performance'),
179 '#path' => 'http://drupal.org/node/627252',
180 ),
181 ),
182 'contribute_code' => array(
183 '#title' => t('Contributing code, designs and patches back to Drupal'),
184 'handbook_page' => array(
185 '#text' => t('Contribute to development'),
186 '#path' => 'http://drupal.org/contribute/development',
187 ),
188 ),
189 'professional' => array(
190 '#title' => t('Drupal consultant or working for a Drupal shop'),
191 ),
192 'chx_or_unconed' => array(
193 '#title' => t(
194 "I'm a !chx or !UnConeD.",
195 array(
196 '!chx' => l(t('chx'), 'http://drupal.org/user/9446'),
197 '!UnConeD' => l(t('UnConeD'), 'http://drupal.org/user/10'),
198 )
199 ),
200 ),
201 ),
202 );
203 return $definitions;
204 }
205
206 /**
207 * Implements hook_checklistapi_checklist_info_alter().
208 *
209 * Alters the checklist from checklistapi_example_checklistapi_checklist_info()
210 * according to
211 * @link http://www.unleashedmind.com/files/drupal-learning-curve.png sun's modifications @endlink
212 * of
213 * @link http://buytaert.net/drupal-learning-curve Dries Buytaert's Drupal learning curve @endlink
214 * .
215 */
216 function checklistapi_example_checklistapi_checklist_info_alter(&$definitions) {
217 $definitions['example_checklist']['#help'] = t('<p>This checklist based on <a href="http://www.unleashedmind.com/files/drupal-learning-curve.png">sun\'s modification</a> of <a href="http://buytaert.net/drupal-learning-curve">Dries Buytaert\'s Drupal learning curve</a> is an example implementation of the <a href="http://drupal.org/project/checklistapi">Checklist API</a>.</p>');
218 $definitions['example_checklist']['i_kick_butt']['advanced_tasks']['#title'] = t('jQuery, Form API, theme and module development');
219 $definitions['example_checklist']['i_kick_butt']['advanced_tasks'] += $definitions['example_checklist']['i_kick_butt']['development'];
220 unset($definitions['example_checklist']['i_kick_butt']['development']);
221 $definitions['example_checklist']['i_kick_butt']['contribute_code']['#title'] = t('Contributing code, designs and patches back to Drupal contrib');
222 unset($definitions['example_checklist']['i_kick_butt']['chx_or_unconed']);
223 $definitions['example_checklist']['core_contributor'] = array(
224 '#title' => t("I'm a core contributor"),
225 'contribute_core_code' => array(
226 '#title' => t('Contribute code and patches to Drupal core'),
227 'handbook_page' => array(
228 '#text' => t('Core contribution mentoring (core office hours)'),
229 '#path' => 'http://drupal.org/core-office-hours',
230 ),
231 'issue_queue' => array(
232 '#text' => t('Core issue queue'),
233 '#path' => 'http://drupal.org/project/issues/drupal',
234 ),
235 ),
236 'unit_tests' => array(
237 '#title' => t('Write unit tests to get own patch committed.'),
238 'handbook_page' => array(
239 '#text' => t('Unit Testing with Simpletest'),
240 '#path' => 'http://drupal.org/node/811254',
241 ),
242 ),
243 'review_core_patches' => array(
244 '#title' => t("Review other people's core patches, understanding coding standards."),
245 'pending_patches' => array(
246 '#text' => t('Pending patches'),
247 '#path' => 'http://drupal.org/project/issues/search/drupal?status[]=8&status[]=13&status[]=14',
248 ),
249 'handbook_page' => array(
250 '#text' => t('Coding standards'),
251 '#path' => 'http://drupal.org/coding-standards',
252 ),
253 ),
254 'security_performance' => array(
255 '#title' => t('Security audits, performance tuning.'),
256 'handbook_page_security' => $definitions['example_checklist']['i_kick_butt']['advanced_tasks']['handbook_page_security'],
257 'handbook_page_performance' => $definitions['example_checklist']['i_kick_butt']['advanced_tasks']['handbook_page_performance'],
258 ),
259 );
260 unset($definitions['example_checklist']['i_kick_butt']['advanced_tasks']['handbook_page_security']);
261 unset($definitions['example_checklist']['i_kick_butt']['advanced_tasks']['handbook_page_performance']);
262 $definitions['example_checklist']['core_maintainer'] = array(
263 '#title' => t("I'm trustworthy for core maintainership"),
264 'add_sub_system' => array(
265 '#title' => t('Rewrite or add a Drupal core sub-system.'),
266 ),
267 'sub_system_maintainer' => array(
268 '#title' => t('Sub-system maintainer.'),
269 ),
270 'core_branch_maintainer' => array(
271 '#title' => t('Core branch maintainer'),
272 ),
273 );
274 $definitions['example_checklist']['know_every_bit_of_core'] = array(
275 '#title' => t('I know every bit of core'),
276 'im_chx' => array(
277 '#title' => t(
278 "I'm !chx.",
279 array('!chx' => l(t('chx'), 'http://drupal.org/user/9446'))
280 ),
281 ),
282 );
283 $definitions['example_checklist']['understand_all_core_patch_implications'] = array(
284 '#title' => t('I understand all implications of a core patch'),
285 'im_chuck_norris' => array(
286 '#title' => t("I'm Chuck Norris."),
287 ),
288 );
289 }