| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
// audit.install
|
| 4 |
|
| 5 |
function audit_install() {
|
| 6 |
db_query("UPDATE {system} SET weight = 1 WHERE name = 'audit'");
|
| 7 |
|
| 8 |
// Create content type
|
| 9 |
$values['name'] = t('Audit process');
|
| 10 |
$values['type'] = 'audit_process';
|
| 11 |
$values['body_label'] = t('Description');
|
| 12 |
$values['node_options'] = array('status' => 'status', 'revision' => 'revision', 'promote' => 0, 'sticky' => 0);
|
| 13 |
$values['upload'] = 0;
|
| 14 |
|
| 15 |
// We need access to 'node_types_form'.
|
| 16 |
include_once './modules/node/content_types.inc';
|
| 17 |
drupal_execute('node_type_form', $values);
|
| 18 |
}
|
| 19 |
|
| 20 |
function audit_uninstall() {
|
| 21 |
// Clean up content types
|
| 22 |
if (db_num_rows(db_query("SELECT * FROM {node_type} WHERE type = 'audit_process'"))) {
|
| 23 |
// TODO: Does this actually work?
|
| 24 |
node_type_delete('audit_process');
|
| 25 |
}
|
| 26 |
else {
|
| 27 |
drupal_set_message(t('Content type %type already deleted', array('%type' => 'audit_process')));
|
| 28 |
}
|
| 29 |
|
| 30 |
watchdog('audit', t('audit.module uninstalled'));
|
| 31 |
}
|