| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: calendar_ical.install,v 1.1.2.6 2010/02/28 14:23:48 karens Exp $ 3 4 /** 5 * Implementation of hook_install(). 6 */ 7 function calendar_ical_install() { 8 db_query("UPDATE {system} SET weight = 1 WHERE name = 'calendar_ical'"); 9 } 10 11 /** 12 * Make sure handlers for disabled Calendar iCal module don't get saved in the view. 13 */ 14 function calendar_ical_uninstall() { 15 $displays = array( 16 'ical', 17 ); 18 db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')"); 19 db_query("DELETE FROM {cache_views}"); 20 } 21 22 function calendar_ical_enable() { 23 db_query("DELETE FROM {cache_views}"); 24 } 25 26 /** 27 * Make sure handlers for disabled Calendar iCal module don't get saved in the view. 28 */ 29 function calendar_ical_disable() { 30 db_query("DELETE FROM {cache_views}"); 31 } 32 33 function calendar_ical_update_last_removed() { 34 return 1; 35 } 36 37 function calendar_ical_update_6000() { 38 $ret = array(); 39 $result = db_query("SELECT * FROM {views_display} d LEFT JOIN {views_view} v ON d.vid = v.vid"); 40 drupal_load('module', 'views'); 41 while ($row = db_fetch_array($result)) { 42 if ($row['display_plugin'] == 'ical') { 43 $options = unserialize($row['display_options']); 44 $options['displays'] = array('calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 'calendar_block_1'); 45 $row['display_plugin'] = 'calendar_period'; 46 $row['display_options'] = serialize($options); 47 db_query("UPDATE {views_display} SET id='%s', display_plugin='%s', display_options='%s' WHERE id='%s'", 'calendar_ical_1', 'calendar_ical', $row['display_options'], $row['id']); 48 db_query("DELETE FROM {views_object_cache} WHERE name = '%s'", $row['name']); 49 } 50 } 51 $ret[] = array('success' => TRUE, 'query' => 'Updated calendar ical displays to use new handlers and ids.'); 52 views_invalidate_cache(); 53 return $ret; 54 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |