Mercurial > hg > rr-repo
diff sites/all/modules/quicktabs/quicktabs.install @ 6:a75ead649730
added biblio, admin_menu and reference modules
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Fri, 20 Sep 2013 11:18:21 +0100 |
parents | b74b41bb73f0 |
children | 134d4b2e75f6 |
line wrap: on
line diff
--- a/sites/all/modules/quicktabs/quicktabs.install Fri Sep 20 10:32:27 2013 +0100 +++ b/sites/all/modules/quicktabs/quicktabs.install Fri Sep 20 11:18:21 2013 +0100 @@ -175,3 +175,35 @@ function quicktabs_update_7302() { registry_rebuild(); } + +/** + * Add support for view modes. + */ +function quicktabs_update_7303() { + foreach (quicktabs_load_multiple() as $quicktab) { + $updated = FALSE; + + foreach ($quicktab->tabs as &$tab) { + if ($tab['type'] === 'node') { + $tab['view_mode'] = !empty($tab['teaser']) ? 'teaser' : 'full'; + unset($tab['teaser']); + $updated = TRUE; + } + } + + if (!$updated) { + continue; + } + + if (empty($quicktab->in_code_only)) { + $result = drupal_write_record('quicktabs', $quicktab, 'machine_name'); + } + else { + $result = drupal_write_record('quicktabs', $quicktab); + } + if (!$result) { + throw new DrupalUpdateException(t('Could not complete the update.')); + } + } + return 'Added support for view modes.'; +} \ No newline at end of file