googlenews.install in Google News sitemap 7
Same filename and directory in other branches
Install, update, and uninstall functions for the GoogleNews module.
File
googlenews.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the GoogleNews module.
*/
/**
* Implementation of googlenews_uninstall().
*/
function googlenews_uninstall() {
variable_del('googlenews_node_types');
variable_del('googlenews_base_url');
variable_del('googlenews_cache_timeout');
variable_del('googlenews_category');
variable_get('googlenews_content_hours');
variable_del('googlenews_publication_name');
variable_del('googlenews_source');
variable_del('googlenews_tag_access');
variable_del('googlenews_tag_genres');
variable_del('googlenews_tag_geo_locations');
variable_del('googlenews_tag_keywords');
variable_del('googlenews_tag_stock_tickers');
variable_del('googlenews_view');
}
/**
* Fix the googlenews_category variable.
*/
function googlenews_update_6000() {
$ret = array();
$node_types = variable_get('googlenews_category', array());
if (!empty($node_types['_gnall'])) {
$node_types = array_keys(node_get_types('names'));
}
else {
unset($node_types['_gnall']);
$node_types = array_keys(array_filter($node_types));
}
variable_set('googlenews_node_types', $node_types);
variable_del('googlenews_category');
return $ret;
}
/**
* Fix the googlenews_publication_name variable.
*/
function googlenews_update_7100() {
$pub_name = variable_get('googlenews_publication_name', '');
$site_name = variable_get('site_name', 'Drupal');
// If the publication name is the same as the site name, remove it.
if ($pub_name == $site_name) {
variable_del('googlenews_publication_name');
drupal_set_message(t('The GoogleNews publication name will automatically use the site name if nothing else is assigned. As the publication name was the same as the site name it has been blanked out.'));
}
}
/**
* Rebuild the menus so that the moved menu item will work.
*/
function googlenews_update_7101() {
menu_rebuild();
}
Functions
Name | Description |
---|---|
googlenews_uninstall | Implementation of googlenews_uninstall(). |
googlenews_update_6000 | Fix the googlenews_category variable. |
googlenews_update_7100 | Fix the googlenews_publication_name variable. |
googlenews_update_7101 | Rebuild the menus so that the moved menu item will work. |