| 1 |
|
<?php |
| 2 |
|
// $Id: follow.install,v 1.1.2.1 2009/04/29 20:37:20 q0rban Exp $ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* @file |
| 6 |
|
* Follow module's install and uninstall code. |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
/** |
| 10 |
|
* Implementation of hook_install(). |
| 11 |
|
*/ |
| 12 |
|
function follow_install() { |
| 13 |
|
drupal_install_schema('follow'); |
| 14 |
|
} |
| 15 |
|
|
| 16 |
|
/** |
| 17 |
|
* Implementation of hook_schema(). |
| 18 |
|
*/ |
| 19 |
|
function follow_schema() { |
| 20 |
|
$schema['follow_links'] = array( |
| 21 |
|
'description' => t('Stores sitewide and user follow links.'), |
| 22 |
|
'fields' => array( |
| 23 |
|
'lid' => array( |
| 24 |
|
'type' => 'serial', |
| 25 |
|
'unsigned' => TRUE, |
| 26 |
|
'not null' => TRUE, |
| 27 |
|
'description' => t('Unique identifier for the {follow_links}.'), |
| 28 |
|
), |
| 29 |
|
'name' => array( |
| 30 |
|
'type' => 'varchar', |
| 31 |
|
'length' => 255, |
| 32 |
|
'not null' => TRUE, |
| 33 |
|
'default' => '', |
| 34 |
|
'description' => t("The machine name of the {follow_links}."), |
| 35 |
|
), |
| 36 |
|
'uid' => array( |
| 37 |
|
'type' => 'int', |
| 38 |
|
'not null' => TRUE, |
| 39 |
|
'default' => 0, |
| 40 |
|
'description' => "User's {users} uid. Sitewide {follow_links} use uid 0", |
| 41 |
|
), |
| 42 |
|
'url' => array( |
| 43 |
|
'type' => 'varchar', |
| 44 |
|
'length' => 255, |
| 45 |
|
'not null' => TRUE, |
| 46 |
|
'default' => '', |
| 47 |
|
'description' => 'The url the {follow_links} should point to.', |
| 48 |
|
), |
| 49 |
|
'weight' => array( |
| 50 |
|
'type' => 'int', |
| 51 |
|
'not null' => TRUE, |
| 52 |
|
'default' => 0, |
| 53 |
|
'size' => 'tiny', |
| 54 |
|
'description' => t('The weight of this {follow_links}.'), |
| 55 |
|
), |
| 56 |
|
), |
| 57 |
|
'primary key' => array('lid'), |
| 58 |
|
'unique keys' => array( |
| 59 |
|
'name_uid' => array('name', 'uid'), |
| 60 |
|
), |
| 61 |
|
); |
| 62 |
|
return $schema; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
/** |
| 66 |
|
* Implementation of hook_uninstall(). |
| 67 |
|
*/ |
| 68 |
|
function follow_uninstall() { |
| 69 |
|
drupal_uninstall_schema('follow'); |
| 70 |
|
variable_del('follow_user_block_title'); |
| 71 |
|
variable_del('follow_site_block_title'); |
| 72 |
|
variable_del('follow_site_block_user'); |
| 73 |
|
cache_clear_all('follow:networks', 'cache'); |
| 74 |
|
} |