| 1 |
<?php
|
| 2 |
// $Id: $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function adlib_install() {
|
| 8 |
// Give adlib a high weight to ensure its nodeapi 'view' op receives
|
| 9 |
// content set by other modules, e.g., content module.
|
| 10 |
db_query("UPDATE {system} SET weight = 15 WHERE name = 'adlib'");
|
| 11 |
|
| 12 |
// Create an adlib node type.
|
| 13 |
if (!node_get_types('type', 'adlib')) {
|
| 14 |
$type = array(
|
| 15 |
'type' => 'adlib',
|
| 16 |
'name' => t('Adlib'),
|
| 17 |
'module' => 'node',
|
| 18 |
'description' => t('An adlib is used to construct a fill-in-the-blanks version of a form.'),
|
| 19 |
'custom' => TRUE,
|
| 20 |
'modified' => TRUE,
|
| 21 |
'locked' => FALSE,
|
| 22 |
);
|
| 23 |
|
| 24 |
$type = (object) _node_type_set_defaults($type);
|
| 25 |
node_type_save($type);
|
| 26 |
|
| 27 |
cache_clear_all();
|
| 28 |
system_modules();
|
| 29 |
menu_rebuild();
|
| 30 |
node_types_rebuild();
|
| 31 |
|
| 32 |
variable_set('node_options_adlib', array('status'));
|
| 33 |
variable_set('adlib_type', 'adlib');
|
| 34 |
}
|
| 35 |
}
|
| 36 |
|