@@ -18,6 +18,8 @@ require_once __DIR__ . '/../../include/utility.inc';
18
18
*
19
19
* Plugins are described by creating a $plugin array which will be used
20
20
* by the system that includes this file.
21
+ *
22
+ * The 'all contexts' is NEEDED to be able to use substitution strings.
21
23
*/
22
24
$ plugin = array (
23
25
'title ' => t ('Patternkit Pattern ' ),
@@ -28,7 +30,7 @@ $plugin = array(
28
30
'content type ' => 'patternkit_patternkit_content_type_content_type ' ,
29
31
'admin info ' => 'patternkit_patternkit_content_type_admin_info ' ,
30
32
'defaults ' => array (),
31
- 'all contexts ' => TRUE , // This is NEEDED to be able to use substitution strings in your pane.
33
+ 'all contexts ' => TRUE ,
32
34
);
33
35
34
36
/**
@@ -49,7 +51,7 @@ function patternkit_patternkit_content_type_content_type($subtype) {
49
51
if (!user_is_anonymous ()) {
50
52
drupal_set_message (
51
53
t (
52
- " The patternkit framework module (:module) appears to be missing. Remove from this panel, or replace the missing code and clear caches. " ,
54
+ ' The patternkit framework module (:module) appears to be missing. Remove from this panel, or replace the missing code and clear caches. ' ,
53
55
array (
54
56
':module ' => $ subtype ,
55
57
)
@@ -110,7 +112,7 @@ function patternkit_patternkit_content_type_admin_title(
110
112
) {
111
113
$ module = _patternkit_get_metadata ($ subtype );
112
114
if (empty ($ module ->title )) {
113
- $ title = " BROKEN/MISSING MODULE " ;
115
+ $ title = ' BROKEN/MISSING MODULE ' ;
114
116
}
115
117
else {
116
118
$ title = $ module ->title ;
@@ -175,14 +177,12 @@ function patternkit_patternkit_content_type_edit_form($form, &$form_state) {
175
177
$ form ['override_title_text ' ],
176
178
$ form ['override_title_heading ' ]);
177
179
178
- // @TODO: Re-enable the other formats.
180
+ // @TODO: Re-enable the other formats like JSON and webcomponent .
179
181
$ form ['presentation_style ' ] = array (
180
182
'#type ' => 'select ' ,
181
183
'#title ' => 'Presentation style ' ,
182
184
'#options ' => array (
183
- // 'webcomponent' => 'Web component',
184
185
'html ' => 'HTML inline ' ,
185
- // 'json' => 'JSON (with js/css)',
186
186
),
187
187
'#default_value ' => isset ($ conf ['presentation_style ' ]) ? $ conf ['presentation_style ' ] : '' ,
188
188
);
@@ -307,7 +307,7 @@ function patternkit_patternkit_content_type_render(
307
307
static $ is_processed ;
308
308
309
309
// Initialize our static (if necessary).
310
- if (is_null ( $ is_processed) ) {
310
+ if ($ is_processed === NULL ) {
311
311
$ is_processed = array ();
312
312
}
313
313
@@ -363,17 +363,8 @@ function patternkit_patternkit_content_type_render(
363
363
),
364
364
)
365
365
);
366
- //
367
- // if (!empty($config['pkdata']['attachments'])) {
368
- // $settings = _patternkit_merge_js(
369
- // $config['pkdata']['attachments'],
370
- // $base_dependencies
371
- // );
372
- // dpm($settings, 'settings');
373
- // dpm($base_dependencies, 'bd');
374
- // }
375
-
376
366
367
+ // @todo Merge attachment JS and dependencies.
377
368
// Build the response object.
378
369
$ block = new stdClass ();
379
370
$ block ->title = '' ;
@@ -396,13 +387,19 @@ function patternkit_patternkit_content_type_render(
396
387
cache_set ($ cid , $ block , 'cache_patternkit ' , time () + $ ttl );
397
388
}
398
389
390
+ // @todo Re-evaluate use of this flag.
399
391
// Set flag to let other modules know content is ngpanes stuff.
400
392
$ block ->ngpane = 1 ;
401
393
402
394
return $ block ;
403
395
}
404
396
405
- /************* Utility functions below *************/
397
+ /**
398
+ * Utility functions.
399
+ *
400
+ * @ingroup utility
401
+ * @{
402
+ */
406
403
407
404
/**
408
405
* Render the actual contents of the module.
@@ -432,7 +429,7 @@ function _patternkit_render_block(
432
429
return 'MISSING/BROKEN ' ;
433
430
}
434
431
435
- if ($ config ['presentation_style ' ] == 'webcomponent ' ) {
432
+ if ($ config ['presentation_style ' ] === 'webcomponent ' ) {
436
433
$ subtype = substr ($ subtype , 3 );
437
434
$ body = "< $ subtype-pattern></ $ subtype-pattern> " ;
438
435
}
@@ -466,8 +463,7 @@ function _patternkit_admin_info_presentation_render(
466
463
) {
467
464
$ result = patternkit_patternkit_content_type_render ($ subtype , $ conf , array (), array ());
468
465
469
- $ output = $ result ->content ;
470
- return $ output ;
466
+ return $ result ->content ;
471
467
}
472
468
473
469
/**
0 commit comments