@@ -18,6 +18,8 @@ require_once __DIR__ . '/../../include/utility.inc';
1818 *
1919 * Plugins are described by creating a $plugin array which will be used
2020 * by the system that includes this file.
21+ *
22+ * The 'all contexts' is NEEDED to be able to use substitution strings.
2123 */
2224$ plugin = array (
2325 'title ' => t ('Patternkit Pattern ' ),
@@ -28,7 +30,7 @@ $plugin = array(
2830 'content type ' => 'patternkit_patternkit_content_type_content_type ' ,
2931 'admin info ' => 'patternkit_patternkit_content_type_admin_info ' ,
3032 'defaults ' => array (),
31- 'all contexts ' => TRUE , // This is NEEDED to be able to use substitution strings in your pane.
33+ 'all contexts ' => TRUE ,
3234);
3335
3436/**
@@ -49,7 +51,7 @@ function patternkit_patternkit_content_type_content_type($subtype) {
4951 if (!user_is_anonymous ()) {
5052 drupal_set_message (
5153 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. ' ,
5355 array (
5456 ':module ' => $ subtype ,
5557 )
@@ -110,7 +112,7 @@ function patternkit_patternkit_content_type_admin_title(
110112) {
111113 $ module = _patternkit_get_metadata ($ subtype );
112114 if (empty ($ module ->title )) {
113- $ title = " BROKEN/MISSING MODULE " ;
115+ $ title = ' BROKEN/MISSING MODULE ' ;
114116 }
115117 else {
116118 $ title = $ module ->title ;
@@ -175,14 +177,12 @@ function patternkit_patternkit_content_type_edit_form($form, &$form_state) {
175177 $ form ['override_title_text ' ],
176178 $ form ['override_title_heading ' ]);
177179
178- // @TODO: Re-enable the other formats.
180+ // @TODO: Re-enable the other formats like JSON and webcomponent .
179181 $ form ['presentation_style ' ] = array (
180182 '#type ' => 'select ' ,
181183 '#title ' => 'Presentation style ' ,
182184 '#options ' => array (
183- // 'webcomponent' => 'Web component',
184185 'html ' => 'HTML inline ' ,
185- // 'json' => 'JSON (with js/css)',
186186 ),
187187 '#default_value ' => isset ($ conf ['presentation_style ' ]) ? $ conf ['presentation_style ' ] : '' ,
188188 );
@@ -307,7 +307,7 @@ function patternkit_patternkit_content_type_render(
307307 static $ is_processed ;
308308
309309 // Initialize our static (if necessary).
310- if (is_null ( $ is_processed) ) {
310+ if ($ is_processed === NULL ) {
311311 $ is_processed = array ();
312312 }
313313
@@ -363,17 +363,8 @@ function patternkit_patternkit_content_type_render(
363363 ),
364364 )
365365 );
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-
376366
367+ // @todo Merge attachment JS and dependencies.
377368 // Build the response object.
378369 $ block = new stdClass ();
379370 $ block ->title = '' ;
@@ -396,13 +387,19 @@ function patternkit_patternkit_content_type_render(
396387 cache_set ($ cid , $ block , 'cache_patternkit ' , time () + $ ttl );
397388 }
398389
390+ // @todo Re-evaluate use of this flag.
399391 // Set flag to let other modules know content is ngpanes stuff.
400392 $ block ->ngpane = 1 ;
401393
402394 return $ block ;
403395}
404396
405- /************* Utility functions below *************/
397+ /**
398+ * Utility functions.
399+ *
400+ * @ingroup utility
401+ * @{
402+ */
406403
407404/**
408405 * Render the actual contents of the module.
@@ -432,7 +429,7 @@ function _patternkit_render_block(
432429 return 'MISSING/BROKEN ' ;
433430 }
434431
435- if ($ config ['presentation_style ' ] == 'webcomponent ' ) {
432+ if ($ config ['presentation_style ' ] === 'webcomponent ' ) {
436433 $ subtype = substr ($ subtype , 3 );
437434 $ body = "< $ subtype-pattern></ $ subtype-pattern> " ;
438435 }
@@ -466,8 +463,7 @@ function _patternkit_admin_info_presentation_render(
466463) {
467464 $ result = patternkit_patternkit_content_type_render ($ subtype , $ conf , array (), array ());
468465
469- $ output = $ result ->content ;
470- return $ output ;
466+ return $ result ->content ;
471467}
472468
473469/**
0 commit comments