| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: index.install,v 1.1.2.2 2009/04/21 19:42:26 xano Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 8 |
|
|
| 9 |
/** |
/** |
| 10 |
* Implementation of hook_schema(). |
* Implementation of hook_schema(). |
| 11 |
*/
function index_schema() { |
*/ |
| 12 |
|
function index_schema() { |
| 13 |
$schema['index_index'] = array( |
$schema['index_index'] = array( |
| 14 |
'description' => 'The base table for indexes', |
'description' => 'The base table for indexes', |
| 15 |
'fields' => array( |
'fields' => array( |
| 31 |
'size' => 'big', |
'size' => 'big', |
| 32 |
'default' => '', |
'default' => '', |
| 33 |
), |
), |
| 34 |
|
'page_enabled' => array( |
| 35 |
|
'descripton' => "1 if the page is enabled, 0 if not.", |
| 36 |
|
'type' => 'int', |
| 37 |
|
'size' => 'tiny', |
| 38 |
|
'not null' => TRUE, |
| 39 |
|
), |
| 40 |
'page_mode' => array( |
'page_mode' => array( |
| 41 |
'descripton' => "The page's display mode. NULL if no page should be created.", |
'descripton' => "The page's display mode. NULL if no page should be created.", |
| 42 |
'type' => 'varchar', |
'type' => 'varchar', |
| 49 |
'length' => 255, |
'length' => 255, |
| 50 |
'default' => '' |
'default' => '' |
| 51 |
), |
), |
| 52 |
|
'block_enabled' => array( |
| 53 |
|
'descripton' => "1 if the block is enabled, 0 if not.", |
| 54 |
|
'type' => 'int', |
| 55 |
|
'size' => 'tiny', |
| 56 |
|
'not null' => TRUE, |
| 57 |
|
), |
| 58 |
'block_mode' => array( |
'block_mode' => array( |
| 59 |
'descripton' => "The block's display mode. NULL if no block should be created.", |
'descripton' => "The block's display mode. NULL if no block should be created.", |
| 60 |
'type' => 'varchar', |
'type' => 'varchar', |
| 73 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 74 |
'not null' => TRUE, |
'not null' => TRUE, |
| 75 |
), |
), |
| 76 |
|
'depth' => array( |
| 77 |
|
'description' => "The layer's depth in the hierarchy.", |
| 78 |
|
'type' => 'int', |
| 79 |
|
'size' => 'tiny', |
| 80 |
|
'default' => 0, |
| 81 |
|
), |
| 82 |
'type' => array( |
'type' => array( |
| 83 |
'description' => "This layer's data type.", |
'description' => "This layer's data type.", |
| 84 |
'type' => 'varchar', |
'type' => 'varchar', |
| 85 |
'length' => 255, |
'length' => 255, |
| 86 |
'not null' => TRUE, |
'not null' => TRUE, |
| 87 |
), |
), |
|
'view' => array( |
|
|
'description' => 'Whether to use a view instead of a query to fetch data for this layer.', |
|
|
'type' => 'int', |
|
|
'size' => 'tiny', |
|
|
'default' => 0, |
|
|
), |
|
| 88 |
'count' => array( |
'count' => array( |
| 89 |
'description' => 'Whether to fetch the record count only for this layer.', |
'description' => 'Whether to fetch the record count only for this layer.', |
| 90 |
'type' => 'int', |
'type' => 'int', |
| 97 |
return $schema; |
return $schema; |
| 98 |
} |
} |
| 99 |
|
|
| 100 |
|
|
| 101 |
/** |
/** |
| 102 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 103 |
*/
function index_install() {
drupal_install_schema('index');
} |
*/ |
| 104 |
|
function index_install() { |
| 105 |
|
drupal_install_schema('index'); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
/** |
/** |
| 109 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 110 |
*/
function index_uninstall() { |
*/ |
| 111 |
|
function index_uninstall() { |
| 112 |
index_delete_variables(); |
index_delete_variables(); |
| 113 |
|
drupal_uninstall_schema('index'); |
| 114 |
//Delete DB table.
drupal_uninstall_schema('index');
} |
} |
| 115 |
|
|
| 116 |
/** |
/** |
| 117 |
* Implementation of hook_enable(). |
* Implementation of hook_enable(). |
| 118 |
*/ |
*/ |
| 119 |
function index_enable() { |
function index_enable() { |
| 120 |
drupal_set_message(st('Index has been enabled. Please proceed to <a href="!settings">the settings page</a> and <a href="!permissions">set up the permissions</a> to get started.', array('!settings' => url('admin/build/index/settings'), '!permissions' => url('admin/user/permissions', array('fragment' => 'module-index'))))); |
drupal_set_message(st('Index has been enabled. Proceed to <a href="!settings">the settings page</a> and <a href="!permissions">configure permissions</a> to get started.', array('!settings' => url('admin/build/index/settings'), '!permissions' => url('admin/user/permissions', array('fragment' => 'module-index'))))); |
| 121 |
} |
} |
| 122 |
|
|
| 123 |
/** |
/** |