? .completion.db ? .git ? .patch ? dr.patch ? drushrc.php ? tmp.patch ? tmp.patch.patch ? tmp.sql ? modules/comment/comment-node-type-form.js ? modules/node/node.diff.inc ? modules/node/node.pages-diff.inc ? modules/simpletest/tests/hook_url_rewrite.info ? modules/simpletest/tests/hook_url_rewrite.module ? modules/simpletest/tests/path.test Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.912 diff -u -F^f -p -r1.912 common.inc --- includes/common.inc 26 May 2009 09:12:28 -0000 1.912 +++ includes/common.inc 27 May 2009 12:29:50 -0000 @@ -3708,6 +3708,13 @@ function drupal_render_children(&$elemen } /** + * A brief alias for drupal_render(), to be used in templates. + */ +function dr(&$element) { + return drupal_render($element); +} + +/** * Function used by uasort to sort structured arrays by weight. */ function element_sort($a, $b) { Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.491 diff -u -F^f -p -r1.491 theme.inc --- includes/theme.inc 26 May 2009 10:41:06 -0000 1.491 +++ includes/theme.inc 27 May 2009 12:29:50 -0000 @@ -1835,10 +1835,6 @@ function template_preprocess(&$variables * Any changes to variables in this preprocessor should also be changed inside * template_preprocess_maintenance_page() to keep all of them consistent. * - * The $variables array contains two keys: - * - 'page': the fully decorated page. - * - 'content': the content of the page, already rendered. - * * @see drupal_render_page * @see page.tpl.php */ @@ -1849,7 +1845,7 @@ function template_preprocess_page(&$vari // Render each region into top level variables. foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { - $variables[$region_key] = empty($variables['page'][$region_key]) ? '' : drupal_render($variables['page'][$region_key]); + $variables[$region_key] = empty($variables['page'][$region_key]) ? array() : $variables['page'][$region_key]; } // Add favicon. Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1059 diff -u -F^f -p -r1.1059 node.module --- modules/node/node.module 27 May 2009 02:01:53 -0000 1.1059 +++ modules/node/node.module 27 May 2009 12:29:51 -0000 @@ -1372,9 +1372,6 @@ function template_preprocess_node(&$vari // Render any comments. $variables['comments'] = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : ''; - // Render the rest of the node into $content. - $variables['content'] = drupal_render($node->content); - // Flatten the node object's member fields. $variables = array_merge((array)$node, $variables); Index: modules/node/node.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.tpl.php,v retrieving revision 1.11 diff -u -F^f -p -r1.11 node.tpl.php --- modules/node/node.tpl.php 28 Apr 2009 19:56:00 -0000 1.11 +++ modules/node/node.tpl.php 27 May 2009 12:29:51 -0000 @@ -7,7 +7,9 @@ * * Available variables: * - $title: the (sanitized) title of the node. - * - $content: Node body or teaser depending on $teaser flag. + * - $content: An array of node items. Use dr($content) to print them all, or + * print a subset such as dr($content['field_example']). Always call + * dr($content) at the end in order to print all remaining items. * - $comments: the themed list of comments (if any). * - $picture: The authors picture of the node output from * theme_user_picture(). @@ -48,6 +50,10 @@ * @see template_preprocess() * @see template_preprocess_node() */ + +// Uncomment the line below to see what variables are available in this template. +// print '
' . check_plain(print_r(get_defined_vars(), TRUE)) . '
'; + ?>
@@ -68,7 +74,7 @@
- +
Index: modules/system/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v retrieving revision 1.21 diff -u -F^f -p -r1.21 page.tpl.php --- modules/system/page.tpl.php 19 May 2009 17:23:16 -0000 1.21 +++ modules/system/page.tpl.php 27 May 2009 12:29:51 -0000 @@ -56,11 +56,11 @@ * - $tabs: Tabs linking to any sub-pages beneath the current page (e.g., the view * and edit tabs when displaying a node). * - $help: Dynamic help text, mostly for admin pages. - * - $content: The main content of the current Drupal page. + * - $content: The main content of the current page. Use dr() to render. * - $feed_icons: A string of all feed icons for the current page. - * - $left: The HTML for the left sidebar. - * - $right: The HTML for the right sidebar. - * - $highlight: The HTML for the highlighted content region. + * - $left: Items for the left sidebar. Use dr() to render. + * - $right: Items for the right sidebar. Use dr() to render. + * - $highlight: Items for the highlighted content region. Use dr() to render. * * Footer/closing data: * - $footer : The footer region. @@ -70,6 +70,10 @@ * @see template_preprocess() * @see template_preprocess_page() */ + +// Uncomment the line below to see what variables are available in this template. +// print '
' . check_plain(print_r(get_defined_vars(), TRUE)) . '
'; + ?> @@ -120,7 +124,7 @@
- +
@@ -141,7 +145,7 @@
-
+

@@ -167,7 +171,7 @@
Index: modules/user/user-profile.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user-profile.tpl.php,v retrieving revision 1.6 diff -u -F^f -p -r1.6 user-profile.tpl.php --- modules/user/user-profile.tpl.php 5 Feb 2009 03:42:58 -0000 1.6 +++ modules/user/user-profile.tpl.php 27 May 2009 12:29:52 -0000 @@ -8,27 +8,13 @@ * This template is used when viewing a registered member's profile page, * e.g., example.com/user/123. 123 being the users ID. * - * By default, all user profile data is printed out with the $user_profile - * variable. If there is a need to break it up you can use $profile instead. - * It is keyed to the name of each category or other data attached to the - * account. If it is a category it will contain all the profile items. By - * default $profile['summary'] is provided which contains data on the user's - * history. Other data can be included by modules. $profile['user_picture'] is - * available by default showing the account picture. - * - * Also keep in mind that profile items and their categories can be defined by - * site administrators. They are also available within $profile. For example, - * if a site is configured with a category of "contact" with - * fields for of addresses, phone numbers and other related info, then doing a - * straight print of $profile['contact'] will output everything in the - * category. This is useful for altering source order and adding custom - * markup for the group. - * - * To check for all available data within $profile, use the code below. - * - * @code - * print '
'. check_plain(print_r($profile, 1)) .'
'; - * @endcode + * Use dr($user_profile) to print all profile items, or print a subset + * such as dr($content['field_example']). Always call dr($user_profile) + * at the end in order to print all remaining items. If the item is a category, + * it will contain all it's profile items. By default, $user_profile['summary'] + * is provided which contains data on the user's history. Other data can be + * included by modules. $user_profile['user_picture'] is available + * for showing the account picture. * * @see user-profile-category.tpl.php * Where the html is handled for the group. @@ -36,14 +22,16 @@ * Where the html is handled for each item in the group. * * Available variables: - * - $user_profile: All user profile data. Ready for print. - * - $profile: Keyed array of profile categories and their items or other data - * provided by modules. + * - $user_profile: An array of profile items. Use dr() to print them. * - TODO D7 : document $FIELD_NAME_rendered variables. * * @see template_preprocess_user_profile() */ + +// Uncomment the line below to see what variables are available in this template. +// print '
' . check_plain(print_r(get_defined_vars(), TRUE)) . '
'; + ?>
- +
Index: modules/user/user.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v retrieving revision 1.38 diff -u -F^f -p -r1.38 user.pages.inc --- modules/user/user.pages.inc 25 May 2009 18:22:31 -0000 1.38 +++ modules/user/user.pages.inc 27 May 2009 12:29:52 -0000 @@ -185,20 +185,11 @@ function user_view($account) { * The $variables array contains the following arguments: * - $account * - * @see user-picture.tpl.php + * @see user-profile.tpl.php */ function template_preprocess_user_profile(&$variables) { $account = $variables['elements']['#account']; - - $variables['profile'] = array(); - // Sort sections by weight - uasort($account->content, 'element_sort'); - // Provide keyed variables so themers can print each section independently. - foreach (element_children($account->content) as $key) { - $variables['profile'][$key] = drupal_render($account->content[$key]); - } - // Collect all profiles to make it easier to print all items at once. - $variables['user_profile'] = implode($variables['profile']); + $variables['user_profile'] = $account->content; // Add $FIELD_NAME_rendered variables for fields. $variables += field_attach_preprocess('user', $account); Index: themes/garland/node.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/node.tpl.php,v retrieving revision 1.9 diff -u -F^f -p -r1.9 node.tpl.php --- themes/garland/node.tpl.php 18 Feb 2009 14:28:25 -0000 1.9 +++ themes/garland/node.tpl.php 27 May 2009 12:29:52 -0000 @@ -14,7 +14,7 @@
- +
Index: themes/garland/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v retrieving revision 1.26 diff -u -F^f -p -r1.26 page.tpl.php --- themes/garland/page.tpl.php 12 May 2009 13:43:46 -0000 1.26 +++ themes/garland/page.tpl.php 27 May 2009 12:29:52 -0000 @@ -15,7 +15,7 @@ -
+
@@ -39,30 +39,30 @@
-
+
>
- +
- +
- +