function panopoly_widgets_uninstall in Panopoly 7
Implementation of hook_uninstall().
File
- modules/
panopoly/ panopoly_widgets/ panopoly_widgets.install, line 19  - An installation file for Panopoly Widgets
 
Code
function panopoly_widgets_uninstall() {
  // Retrieve the file IDs for default files
  $fids = array(
    'panopoly_widgets_default_spotlight_fid' => variable_get('panopoly_widgets_default_spotlight_fid', NULL),
    'panopoly_widgets_default_image_fid' => variable_get('panopoly_widgets_default_image_fid', NULL),
    'panopoly_widgets_default_video_fid' => variable_get('panopoly_widgets_default_video_fid', NULL),
  );
  foreach ($fids as $variable_name => $fid) {
    // Deletes the file
    if (!empty($fid) && ($file = file_load($fid))) {
      file_delete($file);
    }
    // Deletes the variable
    variable_del($variable_name);
  }
  variable_del('panopoly_widgets_spotlight_pause_play_buttons');
  variable_del('panopoly_widgets_spotlight_rotation_time');
}