123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- /**
- * Installer file for Taxonews module
- *
- * @author Frederic G. MARAND
- * @version CVS: $Id: taxonews.install,v 1.2.2.3 2008/06/15 21:19:36 fgm Exp $
- * @copyright 2005-2008 Ouest Syst�mes Informatiques (OSI)
- * @license http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
- * @link http://drupal.org/project/taxonews
- * @since Version 1.10.8.2 of taxonews.module
- * @package taxonews
- */
- /**
- * We just defined this update to have a reference schema version
- *
- * @return array
- */
- function links_filter_update_5100()
- {
- $ret = array();
- drupal_set_message(t('Links_filter schema version is now 5100.'));
- return $ret;
- }
- function links_filter_install()
- {
- $dbType = $GLOBALS['db_type'];
- switch ($dbType)
- {
- case 'mysql':
- case 'mysqli':
- db_query
- (
- "CREATE TABLE {lf_links}
- (
- `lfl_id` int(10) unsigned NOT NULL default '0',
- `module` varchar(64) NOT NULL default 'node',
- `key1` int(10) NOT NULL default 0,
- `key2` int(10) NOT NULL default 0,
- `url` varchar(255) NOT NULL default '',
- PRIMARY KEY (`lfl_id`),
- UNIQUE KEY `ux_url` (`url`,`module`,`key1`,`key2`)
- ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"
- );
- break;
- default:
- drupal_set_message("Unsupported DB type $dbType");
- break;
- }
- }
-
- /**
- * Implement hook_uninstall:
- * - remove configuration settings (persistent variables)
- * - remove blocks
- *
- * By convention, all persistent variables in the main class of a module
- * are named VAR_something, so we can find them all safely using reflection.
- *
- * @return void
- */
- function links_filter_uninstall()
- {
- // 1. Obtain the class definition to enable Reflection
- $pwd = dirname(drupal_get_filename('module', 'links_filter'));
-
- // 2. Remove the module settings
- // Nothing yet
-
- // 3. Remove the module blocks
- $sq = "DELETE FROM {blocks} WHERE module = 'links_filter'";
- $ret = db_query($sq);
- drupal_set_message(t('Removed links_filter blocks.'));
- }
|