From bd6c21849d8ed35f386bfae4d672bcccdba9b98d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= <arne@arnested.dk>
Date: Fri, 10 Feb 2012 11:26:58 +0100
Subject: [PATCH] Generate code according to coding standards.

---
 plugin_stub.drush.inc    |   24 ++++++++++++------------
 plugins/content_type.inc |   26 +++++++++++++-------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/plugin_stub.drush.inc b/plugin_stub.drush.inc
index 22deefe..c310b47 100644
--- a/plugin_stub.drush.inc
+++ b/plugin_stub.drush.inc
@@ -144,9 +144,9 @@ function plugin_stub_write($filename, $content) {
  * code.
  */
 function plugin_stub_write_include_in_module($module, $plugin_type, $plugin_name) {
-  $plugin_code = " if ((\$module == 'ctools' || \$module == 'panels') && (\$plugin == '{$plugin_type}s')) {\n";
+  $plugin_code = "  if ((\$module == 'ctools' || \$module == 'panels') && (\$plugin == '{$plugin_type}s')) {\n";
   if ('task' == $plugin_type) {
-    $plugin_type = " if (\$module == 'page_manager') {\n";
+    $plugin_type = "  if (\$module == 'page_manager') {\n";
   }
 
   if (!function_exists($module .'_ctools_plugin_directory')) {
@@ -156,14 +156,14 @@ function plugin_stub_write_include_in_module($module, $plugin_type, $plugin_name
       array_pop($code);
     }
     $code[] = "\n/**\n";
-    $code[] = " * Implementation of hook_ctools_plugin_directory().\n";
+    $code[] = " * Implements hook_ctools_plugin_directory().\n";
     $code[] = " *\n";
     $code[] = " * Tells CTools (and thus Panels) where to look for plugin code.\n";
     $code[] = " */\n";
     $code[] = "function {$module}_ctools_plugin_directory(\$module, \$plugin) {\n";
     $code[] = $plugin_code;
-    $code[] = "   return 'plugins/' . \$plugin;\n";
-    $code[] = " }\n";
+    $code[] = "    return 'plugins/' . \$plugin;\n";
+    $code[] = "  }\n";
     $code[] = "}\n";
 
     // Write the new function to the module.
@@ -203,15 +203,15 @@ function plugin_stub_write_include_in_module($module, $plugin_type, $plugin_name
       array_pop($code);
     }
     $code[] = "\n/**\n";
-    $code[] = " * Implementation of ctools_plugin_api().\n";
+    $code[] = " * Implements ctools_plugin_api().\n";
     $code[] = " */\n";
     $code[] = "function {$module}_ctools_plugin_api() {\n";
-    $code[] = " \$args = func_get_args();\n";
-    $code[] = " \$module = array_shift(\$args);\n";
-    $code[] = " \$api = array_shift(\$args);\n";
-    $code[] = " if (\$module == 'page_manager' && \$api == 'pages_default') {\n";
-    $code[] = "   return array('version' => 1);\n";
-    $code[] = " }\n";
+    $code[] = "  \$args = func_get_args();\n";
+    $code[] = "  \$module = array_shift(\$args);\n";
+    $code[] = "  \$api = array_shift(\$args);\n";
+    $code[] = "  if (\$module == 'page_manager' && \$api == 'pages_default') {\n";
+    $code[] = "    return array('version' => 1);\n";
+    $code[] = "  }\n";
     $code[] = "}\n";
     // Write the new function to the module.
     file_put_contents($filename, $code);
diff --git a/plugins/content_type.inc b/plugins/content_type.inc
index 3795644..2d7af64 100644
--- a/plugins/content_type.inc
+++ b/plugins/content_type.inc
@@ -10,18 +10,18 @@ return <<<CONTENT
  */
 
 \$plugin = array(
-'title' => t('TITLE'),
-'description' => t('DESCRIPTION.'),
-'content_types' => array('$plugin_name'),
-'defaults' => array('{$prefix}_YOUR_VAR' => ''),
-'category' => t('CATEGORY'),
-'all contexts' => TRUE,
-'single' => TRUE,
+  'title' => t('TITLE'),
+  'description' => t('DESCRIPTION.'),
+  'content_types' => array('$plugin_name'),
+  'defaults' => array('{$prefix}_YOUR_VAR' => ''),
+  'category' => t('CATEGORY'),
+  'all contexts' => TRUE,
+  'single' => TRUE,
 );
 
 /**
-  * 'Edit' callback for the content type.
-  */
+ * 'Edit' callback for the content type.
+ */
 function {$prefix}_content_type_edit_form(&\$form, &\$form_state) {
   \$conf = \$form_state['conf'];
   \$form['{$prefix}_YOUR_VAR'] = array(
@@ -34,8 +34,8 @@ function {$prefix}_content_type_edit_form(&\$form, &\$form_state) {
 }
 
 /**
-  * The submit form stores the data in \$conf.
-  */
+ * The submit form stores the data in \$conf.
+ */
 function {$prefix}_content_type_edit_form_submit(&\$form, &\$form_state) {
   foreach (array_keys(\$form_state['plugin']['defaults']) as \$key) {
     if (isset(\$form_state['values'][\$key])) {
@@ -45,8 +45,8 @@ function {$prefix}_content_type_edit_form_submit(&\$form, &\$form_state) {
 }
 
 /**
-  * Put the output for you content type in the blocks content.
-  */
+ * Put the output for you content type in the blocks content.
+ */
 function {$prefix}_content_type_render(\$subtype, \$conf, \$panel_args, \$context) {
   \$block = new stdClass();
   \$block->content = '';
-- 
1.7.9

