You are here

function featured_content_update_7100 in Featured Content 7

Same name and namespace in other branches
  1. 7.2 featured_content.install \featured_content_update_7100()

Update the view mode display settings.

File

./featured_content.install, line 47
Install, update, and uninstall functions for the Featured Content module.

Code

function featured_content_update_7100() {
  $featured_blocks = variable_get('featured_content_blocks', array());
  if (!empty($featured_blocks)) {
    foreach ($featured_blocks as $delta => $data) {

      // Convert block view mode settings.
      if ($data['display'] == 'teasers') {
        $featured_blocks[$delta]['display'] = 'teaser';
      }
      elseif ($data['display'] == 'full_nodes') {
        $featured_blocks[$delta]['display'] = 'full';
      }

      // Convert more page view mode settings.
      if ($data['more']['display'] == 'teasers') {
        $featured_blocks[$delta]['more']['display'] = 'teaser';
      }
      elseif ($data['display'] == 'full_nodes') {
        $featured_blocks[$delta]['more']['display'] = 'full';
      }
    }
  }
  variable_set('featured_content_blocks', $featured_blocks);
  return array();
}