summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-12 13:43:46 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-12 13:43:46 +0000
commit5e3f50369ffb5d984896ac26fc4b58d8f5bf8fc8 (patch)
tree2224df97f48bc72f44825d5b01f8ed72201eaede
parentf96d0a9ee9874144a19c120de8d13bf7a3d1e3e6 (diff)
downloadbrdo-5e3f50369ffb5d984896ac26fc4b58d8f5bf8fc8.tar.gz
brdo-5e3f50369ffb5d984896ac26fc4b58d8f5bf8fc8.tar.bz2
- Patch #453080 by Gabor Hojtsy: moved the footer message to a block.
-rw-r--r--CHANGELOG.txt3
-rw-r--r--includes/theme.inc1
-rw-r--r--includes/theme.maintenance.inc1
-rw-r--r--modules/system/maintenance-page.tpl.php1
-rw-r--r--modules/system/page.tpl.php2
-rw-r--r--modules/system/system.admin.inc6
-rw-r--r--modules/system/system.install13
-rw-r--r--themes/garland/maintenance-page.tpl.php2
-rw-r--r--themes/garland/page.tpl.php2
9 files changed, 17 insertions, 14 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 2715a99f2..3e92c5248 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -111,7 +111,8 @@ Drupal 7.0, xxxx-xx-xx (development version)
- Page organization
* Made the help text area a full featured region with blocks.
* Site mission is replaced with the highlighted content block region and
- separate RSS feed description settings.
+ separate RSS feed description settings.
+ * The footer message setting was removed in favor of custom blocks.
- Upgraded the core JavaScript library to jQuery version 1.3.2.
- Upgraded the jQuery Forms library to 2.21.
diff --git a/includes/theme.inc b/includes/theme.inc
index c6c0fd333..ccfcbb5e0 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1816,7 +1816,6 @@ function template_preprocess_page(&$variables) {
$variables['front_page'] = url();
$variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb());
$variables['feed_icons'] = drupal_get_feeds();
- $variables['footer_message'] = filter_xss_admin(variable_get('site_footer', FALSE));
$variables['head'] = drupal_get_html_head();
$variables['language'] = $GLOBALS['language'];
$variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 274566429..92fefeece 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -245,7 +245,6 @@ function template_preprocess_maintenance_page(&$variables) {
$variables['front_page'] = url();
$variables['breadcrumb'] = '';
$variables['feed_icons'] = '';
- $variables['footer_message'] = filter_xss_admin(variable_get('site_footer', FALSE));
$variables['head'] = drupal_get_html_head();
$variables['help'] = '';
$variables['language'] = $GLOBALS['language'];
diff --git a/modules/system/maintenance-page.tpl.php b/modules/system/maintenance-page.tpl.php
index baaacd9cd..41ab3f13d 100644
--- a/modules/system/maintenance-page.tpl.php
+++ b/modules/system/maintenance-page.tpl.php
@@ -85,7 +85,6 @@
<div id="footer-wrapper">
<div id="footer">
- <?php print $footer_message; ?>
<?php if (!empty($footer)): print $footer; endif; ?>
</div> <!-- /footer -->
</div> <!-- /footer-wrapper -->
diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php
index fae0e461c..1eda0553c 100644
--- a/modules/system/page.tpl.php
+++ b/modules/system/page.tpl.php
@@ -63,7 +63,6 @@
* - $highlight: The HTML for the highlighted content region.
*
* Footer/closing data:
- * - $footer_message: The footer message as defined in the admin settings.
* - $footer : The footer region.
* - $closure: Final closing markup from any modules that have altered the page.
* This variable should always be output last, after all other dynamic content.
@@ -164,7 +163,6 @@
<div id="footer"><div class="section">
<?php print theme('links', $secondary_menu, array('id' => 'secondary-menu', 'class' => 'links clearfix')); ?>
- <?php if ($footer_message): ?><div id="footer-message"><?php print $footer_message; ?></div><?php endif; ?>
<?php if ($footer): ?><div id="footer-region" class="region"><?php print $footer; ?></div><?php endif; ?>
</div></div> <!-- /.section, /#footer -->
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index d3a607ce3..1c994e26d 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1188,12 +1188,6 @@ function system_site_information_settings() {
'#default_value' => '',
'#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).")
);
- $form['site_footer'] = array(
- '#type' => 'textarea',
- '#title' => t('Footer message'),
- '#default_value' => '',
- '#description' => t('This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages.')
- );
$form['anonymous'] = array(
'#type' => 'textfield',
'#title' => t('Anonymous user'),
diff --git a/modules/system/system.install b/modules/system/system.install
index 67b4d2391..dad1775f5 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -3362,11 +3362,24 @@ function system_update_7021() {
variable_set('feed_description', $mission);
}
+ // Migrate site footer message to a custom block.
+ if ($footer_message = variable_get('site_footer', '')) {
+ $bid = db_insert('box')->fields(array('body' => $footer_message, 'info' => 'Footer message', 'format' => FILTER_FORMAT_DEFAULT))->execute();
+ foreach ($themes_with_blocks as $theme) {
+ // Add site footer block for themes, which had blocks.
+ // Set low weight, so the block comes early (it used to be
+ // before the other blocks).
+ $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('block', '" . $bid . "', '" . $theme . "', 1, -10, 'footer', '', -1)");
+ }
+ drupal_set_message('The footer message was migrated to <a href="' . url('admin/build/block/configure/block/' . $bid) . '">a custom block</a> and set up to appear in the footer. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right. If your theme does not have a footer region, you might need to <a href="' . url('admin/build/block') . '">relocate the block</a>.');
+ }
+
// Remove the variables (even if they were saved empty on the admin interface),
// to avoid keeping clutter in the variables table.
variable_del('contact_form_information');
variable_del('user_registration_help');
variable_del('site_mission');
+ variable_del('site_footer');
// Rebuild theme data, so the new 'help' region is identified.
system_theme_data();
diff --git a/themes/garland/maintenance-page.tpl.php b/themes/garland/maintenance-page.tpl.php
index 27333ad57..5a86d1e65 100644
--- a/themes/garland/maintenance-page.tpl.php
+++ b/themes/garland/maintenance-page.tpl.php
@@ -75,7 +75,7 @@
<div class="clearfix">
<?php print $content ?>
</div>
- <div id="footer"><?php print $footer_message . $footer ?></div>
+ <div id="footer"><?php print $footer ?></div>
</div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->
<?php if ($right): ?>
diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php
index 204df0a25..feda682ca 100644
--- a/themes/garland/page.tpl.php
+++ b/themes/garland/page.tpl.php
@@ -56,7 +56,7 @@
<?php print $content ?>
</div>
<?php print $feed_icons ?>
- <div id="footer"><?php print $footer_message . $footer ?></div>
+ <div id="footer"><?php print $footer ?></div>
</div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->
<?php if ($right): ?>