diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php index 8d2b8c4..0cb7642 100644 --- a/core/themes/bartik/template.php +++ b/core/themes/bartik/template.php @@ -70,6 +70,29 @@ function bartik_process_page(&$variables) { // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } + + // Render all regions ahead of time, so simple variables can be used in the template file. + $variables['header'] = render($variables['page']['header']); + $variables['featured'] = render($variables['page']['featured']); + $variables['sidebar_first'] = render($variables['page']['sidebar_first']); + $variables['highlighted'] = render($variables['page']['highlighted']); + $variables['help'] = render($variables['page']['help']); + $variables['content'] = render($variables['page']['content']); + $variables['sidebar_second'] = render($variables['page']['sidebar_second']); + $variables['triptych_first'] = render($variables['page']['triptych_first']); + $variables['triptych_middle'] = render($variables['page']['triptych_middle']); + $variables['triptych_last'] = render($variables['page']['triptych_last']); + $variables['footer_firstcolumn'] = render($variables['page']['footer_firstcolumn']); + $variables['footer_secondcolumn'] = render($variables['page']['footer_secondcolumn']); + $variables['footer_thirdcolumn'] = render($variables['page']['footer_thirdcolumn']); + $variables['footer_fourthcolumn'] = render($variables['page']['footer_fourthcolumn']); + $variables['footer'] = render($variables['page']['footer']); + + // Convert complex data structures into HTML variables for use in the template file. + $variables['tabs'] = render($variables['tabs']); + $variables['title_prefix'] = render($variables['title_prefix']); + $variables['title_suffix'] = render($variables['title_suffix']); + $variables['action_links'] = render($variables['action_links']); } /** @@ -110,6 +133,54 @@ function bartik_preprocess_node(&$variables) { } /** + * Override or insert variables into the node template. + */ +function bartik_process_node(&$variables) { + // Remove the "Add new comment" link on the teaser page + // or if the comment form is being displayed on the same page. + if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) { + unset($variables['content']['links']['comment']['#links']['comment-add']); + } + + // Render the content ahead of time, so simple variables can be used in the template file. + $variables['comments'] = render($variables['content']['comments']); + $variables['links'] = render($variables['content']['links']); + // Render the content after links and comments. + $variables['content'] = render($variables['content']); + + // Convert complex data structures into HTML variables for use in the template file. + $variables['title_prefix'] = render($title_prefix); + $variables['title_suffix'] = render($title_suffix); +} + +/** + * Override or insert variables into the comment wrapper template. + */ +function bartik_process_comment_wrapper(&$variables) { + // Render the content ahead of time, so simple variables can be used in the template file. + $variables['comments'] = render($variables['content']['comments']); + $variables['comment_form'] = render($variables['content']['comment_form']); + + // Convert complex data structures into HTML variables for use in the template file. + $variables['title_prefix'] = render($title_prefix); + $variables['title_suffix'] = render($title_suffix); +} + +/** + * Override or insert variables into the comment template. + */ +function bartik_process_comment(&$variables) { + // Render the content ahead of time, so simple variables can be used in the template file. + $variables['links'] = render($variables['content']['links']); + // Render the content after links. + $variables['content'] = render($variables['content']); + + // Convert complex data structures into HTML variables for use in the template file. + $variables['title_prefix'] = render($title_prefix); + $variables['title_suffix'] = render($title_suffix); +} + +/** * Override or insert variables into the block template. */ function bartik_preprocess_block(&$variables) { diff --git a/core/themes/bartik/templates/comment-wrapper.tpl.php b/core/themes/bartik/templates/comment-wrapper.tpl.php index 864dc41..59f5db2 100644 --- a/core/themes/bartik/templates/comment-wrapper.tpl.php +++ b/core/themes/bartik/templates/comment-wrapper.tpl.php @@ -12,12 +12,10 @@ * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default value has the following: * - comment-wrapper: The current template type, i.e., "theming hook". - * - $title_prefix (array): An array containing additional output populated by - * modules, intended to be displayed in front of the main title tag that - * appears in the template. - * - $title_suffix (array): An array containing additional output populated by - * modules, intended to be displayed after the main title tag that appears in - * the template. + * - $title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - $title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. * * The following variables are provided for contextual information. * - $node: Node object the comments are attached to. @@ -32,20 +30,21 @@ * into a string within the variable $classes. * * @see template_preprocess_comment_wrapper() + * @see bartik_process_comment_wrapper() * @see theme_comment_wrapper() */ ?>
> - type != 'forum'): ?> - + type != 'forum'): ?> +

- + - + - +

- +
diff --git a/core/themes/bartik/templates/comment.tpl.php b/core/themes/bartik/templates/comment.tpl.php index d64487d..0427567 100644 --- a/core/themes/bartik/templates/comment.tpl.php +++ b/core/themes/bartik/templates/comment.tpl.php @@ -54,6 +54,7 @@ * @see template_preprocess() * @see template_preprocess_comment() * @see template_process() + * @see bartik_process_comment() * @see theme_comment() */ ?> @@ -83,16 +84,14 @@ - + > - +
> - + + +
@@ -100,6 +99,6 @@
- +
diff --git a/core/themes/bartik/templates/node.tpl.php b/core/themes/bartik/templates/node.tpl.php index 234b899..5b37432 100644 --- a/core/themes/bartik/templates/node.tpl.php +++ b/core/themes/bartik/templates/node.tpl.php @@ -76,17 +76,19 @@ * @see template_preprocess() * @see template_preprocess_node() * @see template_process() + * @see bartik_preprocess_node() + * @see bartik_process_node() */ ?>
> - + > - + diff --git a/core/themes/bartik/templates/page.tpl.php b/core/themes/bartik/templates/page.tpl.php index 7b0f990..c12fafd 100644 --- a/core/themes/bartik/templates/page.tpl.php +++ b/core/themes/bartik/templates/page.tpl.php @@ -43,18 +43,18 @@ * - $breadcrumb: The breadcrumb trail for the current page. * * Page content (in order of occurrence in the default page.tpl.php): - * - $title_prefix (array): An array containing additional output populated by + * - $title_prefix: Additional output populated by * modules, intended to be displayed in front of the main title tag that * appears in the template. * - $title: The page title, for use in the actual HTML content. - * - $title_suffix (array): An array containing additional output populated by + * - $title_suffix: Additional output populated by * modules, intended to be displayed after the main title tag that appears in * the template. * - $messages: HTML for status and error messages. Should be displayed * prominently. - * - $tabs (array): Tabs linking to any sub-pages beneath the current page + * - $tabs: Tabs linking to any sub-pages beneath the current page * (e.g., the view and edit tabs when displaying a node). - * - $action_links (array): Actions local to the page, such as 'Add menu' on the + * - $action_links: Actions local to the page, such as 'Add menu' on the * menu administration interface. * - $feed_icons: A string of all feed icons for the current page. * - $node: The node object, if there is an automatically-loaded node @@ -63,20 +63,20 @@ * comment/reply/12345). * * Regions: - * - $page['header']: Items for the header region. - * - $page['featured']: Items for the featured region. - * - $page['highlighted']: Items for the highlighted content region. - * - $page['help']: Dynamic help text, mostly for admin pages. - * - $page['content']: The main content of the current page. - * - $page['sidebar_first']: Items for the first sidebar. - * - $page['triptych_first']: Items for the first triptych. - * - $page['triptych_middle']: Items for the middle triptych. - * - $page['triptych_last']: Items for the last triptych. - * - $page['footer_firstcolumn']: Items for the first footer column. - * - $page['footer_secondcolumn']: Items for the second footer column. - * - $page['footer_thirdcolumn']: Items for the third footer column. - * - $page['footer_fourthcolumn']: Items for the fourth footer column. - * - $page['footer']: Items for the footer region. + * - $header: Content for the header region. + * - $featured: Content for the featured region. + * - $highlighted: Content for the highlighted content region. + * - $help: Dynamic help text, mostly for admin pages. + * - $content: The main content of the current page. + * - $sidebar_first: Content for the first sidebar. + * - $triptych_first: Content for the first triptych. + * - $triptych_middle: Content for the middle triptych. + * - $triptych_last: Content for the last triptych. + * - $footer_firstcolumn: Content for the first footer column. + * - $footer_secondcolumn: Content for the second footer column. + * - $footer_thirdcolumn: Content for the third footer column. + * - $footer_fourthcolumn: Content for the fourth footer column. + * - $footer: Content for the footer region. * * @see template_preprocess() * @see template_preprocess_page() @@ -120,7 +120,7 @@
- + - + @@ -176,41 +176,43 @@ - +
-
+ +
+ - +

- +
- +
- + - +
- + @@ -218,26 +220,26 @@
- - - + + +