t('A table for storing user Navigate settings.'), 'fields' => array( 'wid' => array( 'description' => t('The primary identifier for a Navigate widget.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), 'uid' => array( 'description' => t('The primary identifier for a user'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), 'name' => array( 'description' => t('The name identifier for Navigate widgets.'), 'type' => 'varchar', 'length' => 250, 'not null' => TRUE, 'default' => ''), 'value' => array( 'description' => t('The value of the Navigate widget setting.'), 'type' => 'text', 'size' => 'big', 'not null' => TRUE, 'default' => ''), ), ); $schema['navigate_widgets'] = array( 'description' => t('A table for storing widgets.'), 'fields' => array( 'wid' => array( 'description' => t('The primary identifier for a Navigate widget.'), 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'uid' => array( 'description' => t('The primary identifier for a user'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), 'type' => array( 'description' => t('The type of widget.'), 'type' => 'varchar', 'length' => 250, 'not null' => TRUE, 'default' => ''), 'module' => array( 'description' => t('The module the widget belongs to.'), 'type' => 'varchar', 'length' => 250, 'not null' => TRUE, 'default' => ''), 'weight' => array( 'description' => t('The weight of a widget.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), ), 'unique keys' => array( 'wid' => array('wid') ), 'primary key' => array('wid'), ); $schema['cache_navigate'] = drupal_get_schema_unprocessed('system', 'cache'); $schema['cache_navigate']['description'] = 'Cache table for Navigate widgets to store various data.'; return $schema; } /** * Implementation of hook_install(). */ function navigate_install() { drupal_install_schema('navigate'); db_query("UPDATE {system} SET weight = 100 WHERE name = 'navigate'"); drupal_set_message(t('Navigate has been installed. To use navigate, click the semi-hidden icon in the upper left hand corner of the screen. For more help, visit '. l('/admin/help/navigate', 'admin/help/navigate') .'. Make sure to enable it for your users in '. l('administer permissions', 'admin/user/permissions') .'.')); } /** * Implementation of hook_uninstall(). */ function navigate_uninstall() { drupal_uninstall_schema('navigate'); db_query("DELETE FROM {variable} WHERE name LIKE 'navigate_%'"); drupal_set_message(t('Navigate variables and tables have been removed.')); } /** * Change caching tables */ function navigate_update_1() { $ret = array(); if (!db_table_exists('cache_navigate')) { $schema = drupal_get_schema_unprocessed('system', 'cache'); db_create_table($ret, 'cache_navigate', $schema); } if (db_table_exists('navigate_cache')) { $ret[] = update_sql("DROP TABLE {navigate_cache}"); } return $ret; }