| 1 |
<?php
|
| 2 |
// $Id: creativecommons_lite.install,v 1.2.2.1 2007/05/19 16:43:53 gloscon Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_schema().
|
| 6 |
*/
|
| 7 |
function creativecommons_lite_schema() {
|
| 8 |
$schema['creativecommons_lite'] = array(
|
| 9 |
'description' => t('Creative Commons license to node mapping.'),
|
| 10 |
'fields' => array(
|
| 11 |
'nid' => array(
|
| 12 |
'description' => t('Node identifier.'),
|
| 13 |
'type' => 'int',
|
| 14 |
'unsigned' => TRUE,
|
| 15 |
'not null' => TRUE
|
| 16 |
),
|
| 17 |
'licence' => array(
|
| 18 |
'description' => t('Creative Commons node license.'),
|
| 19 |
'type' => 'varchar',
|
| 20 |
'not null' => TRUE,
|
| 21 |
'length' => 12,
|
| 22 |
'default' => ''
|
| 23 |
),
|
| 24 |
),
|
| 25 |
'primary key' => array('nid'),
|
| 26 |
);
|
| 27 |
|
| 28 |
return $schema;
|
| 29 |
}
|
| 30 |
|
| 31 |
|
| 32 |
/**
|
| 33 |
* Implementation of hook_install()
|
| 34 |
*/
|
| 35 |
function creativecommons_lite_install() {
|
| 36 |
$result = drupal_install_schema('creativecommons_lite');
|
| 37 |
|
| 38 |
if (count($result) > 0) {
|
| 39 |
drupal_set_message(t('Creative Commons Lite module installed.'));
|
| 40 |
}
|
| 41 |
else {
|
| 42 |
drupal_set_message(t('Creative Commons Lite table creation failed. Please "uninstall" the module and retry.'));
|
| 43 |
}
|
| 44 |
}
|
| 45 |
|
| 46 |
|
| 47 |
/**
|
| 48 |
* Implementation of hook_uninstall().
|
| 49 |
*/
|
| 50 |
function creativecommons_lite_uninstall() {
|
| 51 |
drupal_uninstall_schema('creativecommons_lite');
|
| 52 |
|
| 53 |
variable_del('creativecommons_lite_mandatory');
|
| 54 |
variable_del('creativecommons_lite_default_licence');
|
| 55 |
variable_del('creativecommons_lite_licence_options');
|
| 56 |
variable_del('creativecommons_lite_jurisdiction');
|
| 57 |
variable_del('creativecommons_lite_icon_style');
|
| 58 |
variable_del('creativecommons_lite_no_text');
|
| 59 |
|
| 60 |
// TODO: remove the content type variables
|
| 61 |
}
|