| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function icon_install() {
|
| 8 |
// Create tables.
|
| 9 |
drupal_install_schema('icon');
|
| 10 |
}
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_uninstall().
|
| 14 |
*/
|
| 15 |
function icon_uninstall() {
|
| 16 |
// Remove installed iconsets.
|
| 17 |
db_query("DELETE FROM {system} WHERE type = 'iconset'");
|
| 18 |
// Remove tables.
|
| 19 |
drupal_uninstall_schema('icon');
|
| 20 |
}
|
| 21 |
|
| 22 |
/**
|
| 23 |
* Implementation of hook_schema().
|
| 24 |
*/
|
| 25 |
function icon_schema() {
|
| 26 |
$schema['iconsets'] = array(
|
| 27 |
'description' => t('Stores the states of icon sets for enabled themes.'),
|
| 28 |
'fields' => array(
|
| 29 |
'iconset' => array(
|
| 30 |
'description' => t("The icon set's {system}.name."),
|
| 31 |
'type' => 'varchar',
|
| 32 |
'length' => 255,
|
| 33 |
'not null' => TRUE,
|
| 34 |
'default' => ''),
|
| 35 |
'theme' => array(
|
| 36 |
'description' => t("The theme's {system}.name."),
|
| 37 |
'type' => 'varchar',
|
| 38 |
'length' => 255,
|
| 39 |
'not null' => TRUE,
|
| 40 |
'default' => ''),
|
| 41 |
'status' => array(
|
| 42 |
'description' => t('Boolean indicating whether or not this icon set is enabled for this theme.'),
|
| 43 |
'type' => 'int',
|
| 44 |
'not null' => TRUE,
|
| 45 |
'default' => 0),
|
| 46 |
'weight' => array(
|
| 47 |
'description' => t("The importance given to this icon set when determining which icon set to load an icon from. Equal-weighted icon sets are ordered by name."),
|
| 48 |
'type' => 'int',
|
| 49 |
'not null' => TRUE,
|
| 50 |
'default' => 0),
|
| 51 |
),
|
| 52 |
);
|
| 53 |
|
| 54 |
return $schema;
|
| 55 |
}
|