summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/page.tpl.php20
-rw-r--r--modules/system/region.tpl.php32
-rw-r--r--modules/system/system.module13
3 files changed, 49 insertions, 16 deletions
diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php
index 417a18c3f..c7c0d5526 100644
--- a/modules/system/page.tpl.php
+++ b/modules/system/page.tpl.php
@@ -86,11 +86,7 @@
</div> <!-- /#name-and-slogan -->
<?php endif; ?>
- <?php if ($page['header']): ?>
- <div id="header-region" class="region">
- <?php print render($page['header']); ?>
- </div>
- <?php endif; ?>
+ <?php print render($page['header']); ?>
</div></div> <!-- /.section, /#header -->
@@ -114,20 +110,18 @@
<?php if ($tabs): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?><ul class="action-links"><?php print $action_links; ?></ul><?php endif; ?>
- <div id="content-area" class="region">
- <?php print render($page['content']); ?>
- </div> <!-- /#content-area -->
+ <?php print render($page['content']); ?>
<?php print $feed_icons; ?>
</div></div> <!-- /.section, /#content -->
<?php if ($page['sidebar_first']): ?>
- <div id="sidebar-first" class="column sidebar"><div class="section region">
+ <div id="sidebar-first" class="column sidebar"><div class="section">
<?php print render($page['sidebar_first']); ?>
</div></div> <!-- /.section, /#sidebar-first -->
<?php endif; ?>
<?php if ($page['sidebar_second']): ?>
- <div id="sidebar-second" class="column sidebar"><div class="section region">
+ <div id="sidebar-second" class="column sidebar"><div class="section">
<?php print render($page['sidebar_second']); ?>
</div></div> <!-- /.section, /#sidebar-second -->
<?php endif; ?>
@@ -136,11 +130,7 @@
<div id="footer"><div class="section">
<?php print theme('links', $secondary_menu, array('id' => 'secondary-menu', 'class' => array('links', 'clearfix')), t('Secondary menu')); ?>
- <?php if ($page['footer']): ?>
- <div id="footer-region" class="region">
- <?php print render($page['footer']); ?>
- </div>
- <?php endif; ?>
+ <?php print render($page['footer']); ?>
</div></div> <!-- /.section, /#footer -->
</div></div> <!-- /#page, /#page-wrapper -->
diff --git a/modules/system/region.tpl.php b/modules/system/region.tpl.php
new file mode 100644
index 000000000..8d10e78df
--- /dev/null
+++ b/modules/system/region.tpl.php
@@ -0,0 +1,32 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Default theme implementation to display a region.
+ *
+ * Available variables:
+ * - $content: The content for this region, typically blocks.
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the following:
+ * - region: The current template type, i.e., "theming hook".
+ * - region-[name]: The name of the region with underscores replaced with
+ * dashes. For example, the page_top region would have a region-page-top class.
+ * - $region: The name of the region variable as defined in the theme's .info file.
+ *
+ * Helper variables:
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
+ * - $is_admin: Flags true when the current user is an administrator.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_region()
+ * @see template_process()
+ */
+?>
+<div class="<?php print $classes; ?>">
+ <?php print $content; ?>
+</div>
diff --git a/modules/system/system.module b/modules/system/system.module
index 6a5d8187c..4464e6c54 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2714,7 +2714,6 @@ function theme_system_compact_link() {
return $output;
}
-
/**
* Send Drupal and the major version number in the META GENERATOR HTML.
*
@@ -2802,6 +2801,18 @@ function system_page_build(&$page) {
'#markup' => theme('system_run_cron_image', 'system/run-cron-image'),
);
}
+
+ // Find all block regions so they can be rendered.
+ $regions = system_region_list($GLOBALS['theme']);
+
+ // Load all region content assigned via blocks.
+ foreach (array_keys($regions) as $region) {
+ // Don't render empty regions.
+ if (!empty($page[$region])) {
+ $page[$region]['#theme_wrappers'][] = 'region';
+ $page[$region]['#region'] = $region;
+ }
+ }
}
/**