From 2d922b15d4a5425f4f2091893a187b86c85616f4 Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Sat, 20 Jul 2013 20:10:28 -0400 Subject: [PATCH 1/3] changes parameters in preprocess functions to match api documentation --- templates/shared/template.php.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/shared/template.php.erb b/templates/shared/template.php.erb index f7db76f..499d42a 100644 --- a/templates/shared/template.php.erb +++ b/templates/shared/template.php.erb @@ -8,7 +8,7 @@ * @param $hook * The name of the template being rendered ("maintenance_page" in this case.) */ -function <%= project_name %>_preprocess_maintenance_page(&$vars, $hook) { +function <%= project_name %>_preprocess_maintenance_page(&$variables) { // When a variable is manipulated or added in preprocess_html or // preprocess_page, that same work is probably needed for the maintenance page // as well, so we can just re-use those functions to do that work here. @@ -47,7 +47,7 @@ function <%= project_name %>_modernizr_load_alter(&$load) { * The name of the template being rendered ("html" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_html(&$vars) { +function <%= project_name %>_preprocess_html(&$variables) { } @@ -60,7 +60,7 @@ function <%= project_name %>_preprocess_html(&$vars) { * The name of the template being rendered ("page" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_page(&$vars) { +function <%= project_name %>_preprocess_page(&$variables) { } @@ -73,7 +73,7 @@ function <%= project_name %>_preprocess_page(&$vars) { * The name of the template being rendered ("region" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_region(&$vars, $hook) { +function <%= project_name %>_preprocess_region(&$variables) { } // */ @@ -87,7 +87,7 @@ function <%= project_name %>_preprocess_region(&$vars, $hook) { * The name of the template being rendered ("block" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_block(&$vars, $hook) { +function <%= project_name %>_preprocess_block(&$variables) { } // */ @@ -101,7 +101,7 @@ function <%= project_name %>_preprocess_block(&$vars, $hook) { * The name of the template being rendered ("entity" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_entity(&$vars, $hook) { +function <%= project_name %>_preprocess_entity(&$variables) { } // */ @@ -115,7 +115,7 @@ function <%= project_name %>_preprocess_entity(&$vars, $hook) { * The name of the template being rendered ("node" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_node(&$vars, $hook) { +function <%= project_name %>_preprocess_node(&$variables) { $node = $vars['node']; } // */ @@ -129,7 +129,7 @@ function <%= project_name %>_preprocess_node(&$vars, $hook) { * The name of the template being rendered ("field" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_field(&$vars, $hook) { +function <%= project_name %>_preprocess_field(&$variables, $hook) { } // */ @@ -143,7 +143,7 @@ function <%= project_name %>_preprocess_field(&$vars, $hook) { * The name of the template being rendered ("comment" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_comment(&$vars, $hook) { +function <%= project_name %>_preprocess_comment(&$variables) { $comment = $vars['comment']; } // */ From 0915131681fc7223e8ee3f0485430046247a61bb Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Sun, 21 Jul 2013 13:14:23 -0400 Subject: [PATCH 2/3] edits function comments --- templates/shared/template.php.erb | 34 ++++++++----------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/templates/shared/template.php.erb b/templates/shared/template.php.erb index 499d42a..1a8761b 100644 --- a/templates/shared/template.php.erb +++ b/templates/shared/template.php.erb @@ -3,10 +3,8 @@ /** * Override or insert variables into the maintenance page template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("maintenance_page" in this case.) */ function <%= project_name %>_preprocess_maintenance_page(&$variables) { // When a variable is manipulated or added in preprocess_html or @@ -41,10 +39,8 @@ function <%= project_name %>_modernizr_load_alter(&$load) { /** * Implements hook_preprocess_html() * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("html" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_html(&$variables) { @@ -54,10 +50,8 @@ function <%= project_name %>_preprocess_html(&$variables) { /** * Override or insert variables into the page template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("page" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_page(&$variables) { @@ -67,10 +61,8 @@ function <%= project_name %>_preprocess_page(&$variables) { /** * Override or insert variables into the region templates. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("region" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_region(&$variables) { @@ -81,10 +73,8 @@ function <%= project_name %>_preprocess_region(&$variables) { /** * Override or insert variables into the block templates. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("block" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_block(&$variables) { @@ -95,10 +85,8 @@ function <%= project_name %>_preprocess_block(&$variables) { /** * Override or insert variables into the entity template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("entity" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_entity(&$variables) { @@ -109,10 +97,8 @@ function <%= project_name %>_preprocess_entity(&$variables) { /** * Override or insert variables into the node template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("node" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_node(&$variables) { @@ -123,7 +109,7 @@ function <%= project_name %>_preprocess_node(&$variables) { /** * Override or insert variables into the field template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("field" in this case.) @@ -137,10 +123,8 @@ function <%= project_name %>_preprocess_field(&$variables, $hook) { /** * Override or insert variables into the comment template. * - * @param $vars + * @param $variables * An array of variables to pass to the theme template. - * @param $hook - * The name of the template being rendered ("comment" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_comment(&$variables) { From 63a327a5f893100e9b88bf2397da0e78552ca28f Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Sun, 21 Jul 2013 22:22:07 -0400 Subject: [PATCH 3/3] changes $variables to $vars --- templates/shared/template.php.erb | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/templates/shared/template.php.erb b/templates/shared/template.php.erb index 1a8761b..6192295 100644 --- a/templates/shared/template.php.erb +++ b/templates/shared/template.php.erb @@ -3,15 +3,15 @@ /** * Override or insert variables into the maintenance page template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ -function <%= project_name %>_preprocess_maintenance_page(&$variables) { +function <%= project_name %>_preprocess_maintenance_page(&$vars) { // When a variable is manipulated or added in preprocess_html or // preprocess_page, that same work is probably needed for the maintenance page // as well, so we can just re-use those functions to do that work here. - // <%= project_name %>_preprocess_html($variables, $hook); - // <%= project_name %>_preprocess_page($variables, $hook); + // <%= project_name %>_preprocess_html($vars); + // <%= project_name %>_preprocess_page($vars); // This preprocessor will also be used if the db is inactive. To ensure your // theme is used, add the following line to your settings.php file: @@ -39,33 +39,33 @@ function <%= project_name %>_modernizr_load_alter(&$load) { /** * Implements hook_preprocess_html() * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_html(&$variables) { +function <%= project_name %>_preprocess_html(&$vars) { } /** * Override or insert variables into the page template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_page(&$variables) { +function <%= project_name %>_preprocess_page(&$vars) { } /** * Override or insert variables into the region templates. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_region(&$variables) { +function <%= project_name %>_preprocess_region(&$vars) { } // */ @@ -73,11 +73,11 @@ function <%= project_name %>_preprocess_region(&$variables) { /** * Override or insert variables into the block templates. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_block(&$variables) { +function <%= project_name %>_preprocess_block(&$vars) { } // */ @@ -85,11 +85,11 @@ function <%= project_name %>_preprocess_block(&$variables) { /** * Override or insert variables into the entity template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_entity(&$variables) { +function <%= project_name %>_preprocess_entity(&$vars) { } // */ @@ -97,11 +97,11 @@ function <%= project_name %>_preprocess_entity(&$variables) { /** * Override or insert variables into the node template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_node(&$variables) { +function <%= project_name %>_preprocess_node(&$vars) { $node = $vars['node']; } // */ @@ -109,13 +109,13 @@ function <%= project_name %>_preprocess_node(&$variables) { /** * Override or insert variables into the field template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("field" in this case.) */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_field(&$variables, $hook) { +function <%= project_name %>_preprocess_field(&$vars, $hook) { } // */ @@ -123,11 +123,11 @@ function <%= project_name %>_preprocess_field(&$variables, $hook) { /** * Override or insert variables into the comment template. * - * @param $variables + * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function -function <%= project_name %>_preprocess_comment(&$variables) { +function <%= project_name %>_preprocess_comment(&$vars) { $comment = $vars['comment']; } // */