diff --git a/profiles/unl_profile/unl_profile.install b/profiles/unl_profile/unl_profile.install index 4d67bfa13405d6603397026c23c11f05b49d9506..eccf2bccccfe6c643ac8ba795bebf93d0f0332ae 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 e150ba816ea3629e47cb5e99e64a7b7d207927d1..aa93e9a6e1f077cc46f1a3c885f87fc1e717e3e8 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 48deb3b0541ea8cd4bc74e3c1f99da41bac24d60..4c53fb3b5d639e0e49cb2120c32bc529486ac43e 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 b3859162cb0cc8bdecda2da531f44564b2be0a79..03b9f712fbeeea2badfb870b1d5519c85988e54f 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']);