| 1 |
<?php
|
| 2 |
// $Id: render.install,v 1.7 2008/09/09 11:13:26 sun Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_schema().
|
| 6 |
*/
|
| 7 |
function render_schema() {
|
| 8 |
$schema['render'] = array(
|
| 9 |
'description' => t('Stores dynamic rendering rules.'),
|
| 10 |
'fields' => array(
|
| 11 |
'rid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE,
|
| 12 |
'description' => t('The primary identifier for a rendering rule.'),
|
| 13 |
),
|
| 14 |
'plugin' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE,
|
| 15 |
'description' => t('The plugin to use for a rendering rule.'),
|
| 16 |
),
|
| 17 |
'name' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE,
|
| 18 |
'description' => t('The internal name/title of the rendering rule.'),
|
| 19 |
),
|
| 20 |
'selector' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE,
|
| 21 |
'description' => t('The CSS selector of the rendering rule.'),
|
| 22 |
),
|
| 23 |
'properties' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE,
|
| 24 |
'description' => t('The properties of the rendering rule.'),
|
| 25 |
),
|
| 26 |
'weight' => array('type' => 'float', 'not null' => TRUE, 'default' => 0,
|
| 27 |
'description' => t('The weight of the rendering rule.'),
|
| 28 |
),
|
| 29 |
),
|
| 30 |
'primary key' => array('rid'),
|
| 31 |
);
|
| 32 |
return $schema;
|
| 33 |
}
|
| 34 |
|
| 35 |
/**
|
| 36 |
* Implementation of hook_uninstall().
|
| 37 |
*/
|
| 38 |
function render_uninstall() {
|
| 39 |
db_query("DELETE FROM {variable} WHERE name LIKE 'render_%%'");
|
| 40 |
|
| 41 |
// Remove all generated files.
|
| 42 |
// @see http://drupal.org/node/573292
|
| 43 |
// file_unmanaged_delete_recursive('public://render');
|
| 44 |
$filedir = file_directory_path('public') . '/render';
|
| 45 |
file_unmanaged_delete_recursive($filedir);
|
| 46 |
}
|
| 47 |
|