comparison 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
comparison
equal deleted inserted replaced
5:d72257b2ddc2 6:a75ead649730
173 * Rebuild the registry because of changed method name. 173 * Rebuild the registry because of changed method name.
174 */ 174 */
175 function quicktabs_update_7302() { 175 function quicktabs_update_7302() {
176 registry_rebuild(); 176 registry_rebuild();
177 } 177 }
178
179 /**
180 * Add support for view modes.
181 */
182 function quicktabs_update_7303() {
183 foreach (quicktabs_load_multiple() as $quicktab) {
184 $updated = FALSE;
185
186 foreach ($quicktab->tabs as &$tab) {
187 if ($tab['type'] === 'node') {
188 $tab['view_mode'] = !empty($tab['teaser']) ? 'teaser' : 'full';
189 unset($tab['teaser']);
190 $updated = TRUE;
191 }
192 }
193
194 if (!$updated) {
195 continue;
196 }
197
198 if (empty($quicktab->in_code_only)) {
199 $result = drupal_write_record('quicktabs', $quicktab, 'machine_name');
200 }
201 else {
202 $result = drupal_write_record('quicktabs', $quicktab);
203 }
204 if (!$result) {
205 throw new DrupalUpdateException(t('Could not complete the update.'));
206 }
207 }
208 return 'Added support for view modes.';
209 }