From 1e3f73bec69e76e5f88c24d54114afa3e444190b Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Wed, 29 Jun 2011 19:52:12 +0000
Subject: [PATCH] [gh-154] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@795 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 profiles/unl_profile/unl_profile.install |  6 +++++-
 sites/all/modules/unl/unl.install        | 24 ++++++++++++++++++++++++
 sites/all/modules/unl/unl_migration.php  |  3 ++-
 sites/all/themes/unl_wdn/page.tpl.php    | 21 +++------------------
 4 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/profiles/unl_profile/unl_profile.install b/profiles/unl_profile/unl_profile.install
index 4d67bfa1..eccf2bcc 100644
--- a/profiles/unl_profile/unl_profile.install
+++ b/profiles/unl_profile/unl_profile.install
@@ -105,7 +105,7 @@ EOF;
   // Enable some standard blocks.
 
   db_insert('block')
-    ->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'))
+    ->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'title', 'cache'))
     ->values(array(
       'module' => 'block',
       'delta'  => 101,
@@ -114,6 +114,7 @@ EOF;
       'weight' => 0,
       'region' => 'contactinfo',
       'pages'  => '',
+      'title'  => 'Contact Us',
       'cache'  => DRUPAL_CACHE_GLOBAL,
     ))
     ->values(array(
@@ -124,6 +125,7 @@ EOF;
       'weight' => 0,
       'region' => 'leftcollinks',
       'pages'  => '',
+      'title'  => 'Related Links',
       'cache'  => DRUPAL_CACHE_GLOBAL,
     ))
     ->values(array(
@@ -134,6 +136,7 @@ EOF;
       'weight' => 0,
       'region' => 'optionalfooter',
       'pages'  => '',
+      'title'  => '<none>',
       'cache'  => DRUPAL_CACHE_GLOBAL,
     ))
     ->values(array(
@@ -144,6 +147,7 @@ EOF;
       'weight' => 0,
       'region' => 'footercontent',
       'pages'  => '',
+      'title'  => '<none>',
       'cache'  => DRUPAL_CACHE_GLOBAL,
     ))
     ->execute();
diff --git a/sites/all/modules/unl/unl.install b/sites/all/modules/unl/unl.install
index e150ba81..aa93e9a6 100644
--- a/sites/all/modules/unl/unl.install
+++ b/sites/all/modules/unl/unl.install
@@ -334,3 +334,27 @@ function unl_update_7108() {
     'default'  => '',
   ));
 }
+
+// Update blocks to have correct titles, to correspond to a profile/theme update.
+function unl_update_7109() {
+  db_update('block')
+    ->condition('title', '')
+    ->condition('region', 'leftcollinks')
+    ->fields(array('title' => 'Related Links'))
+    ->execute();
+  db_update('block')
+    ->condition('title', '')
+    ->condition('region', 'contactinfo')
+    ->fields(array('title' => 'Contact Us'))
+    ->execute();
+  db_update('block')
+    ->condition('title', '')
+    ->condition('region', 'optionalfooter')
+    ->fields(array('title' => '<none>'))
+    ->execute();
+  db_update('block')
+    ->condition('title', '')
+    ->condition('region', 'footercontent')
+    ->fields(array('title' => '<none>'))
+    ->execute();
+}
diff --git a/sites/all/modules/unl/unl_migration.php b/sites/all/modules/unl/unl_migration.php
index 48deb3b0..4c53fb3b 100644
--- a/sites/all/modules/unl/unl_migration.php
+++ b/sites/all/modules/unl/unl_migration.php
@@ -482,9 +482,10 @@ class Unl_Migration_Tool
       $this->_blocks['contact_info'] = $this->_get_instance_editable_content($html, 'contactinfo');
       $this->_blocks['optional_footer'] = $this->_get_instance_editable_content($html, 'optionalfooter');
       $this->_blocks['footer_content'] = $this->_get_instance_editable_content($html, 'footercontent');
-      
+      // @TODO replace these with str_replace calls
       $this->_blocks['related_links'] = trim(strtr($this->_blocks['related_links'], array('<h3>Related Links</h3>' => '')));
       $this->_blocks['contact_info'] = trim(strtr($this->_blocks['contact_info'], array('<h3>Contacting Us</h3>' => '')));
+      $this->_blocks['contact_info'] = trim(strtr($this->_blocks['contact_info'], array('<h3>Contact Us</h3>' => '')));
     }
     
     private function _create_blocks() {
diff --git a/sites/all/themes/unl_wdn/page.tpl.php b/sites/all/themes/unl_wdn/page.tpl.php
index b3859162..03b9f712 100644
--- a/sites/all/themes/unl_wdn/page.tpl.php
+++ b/sites/all/themes/unl_wdn/page.tpl.php
@@ -127,30 +127,15 @@ if ($page['sidebar_first'] && !$page['sidebar_second']) {
 } 
 
 // Related Links
-$leftcollinks = '';
 if ($page['leftcollinks']) {
-  $leftcollinks = render($page['leftcollinks']);
+  $t->leftcollinks = render($page['leftcollinks']);
 }
 
-$t->leftcollinks = <<<EOF
-
-<h3>Related Links</h3>
-$leftcollinks
-EOF;
-
-// Contacting Us
-$contactinfo = '';
+// Contact Us
 if ($page['contactinfo']) {
-  $contactinfo = render($page['contactinfo']);
+  $t->contactinfo = render($page['contactinfo']);
 }
 
-$t->contactinfo = <<<EOF
-
-<h3>Contacting Us</h3>
-$contactinfo
-EOF;
-
-
 // Optional Footer
 if ($page['optionalfooter']) {
   $t->optionalfooter = render($page['optionalfooter']);
-- 
GitLab