| 1 |
|
<?php |
| 2 |
|
// $Id$ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* @file |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
|
/** |
| 9 |
|
* Implementation of hook_install() |
| 10 |
|
*/ |
| 11 |
|
function blogroll_install() { |
| 12 |
|
$path = drupal_get_path('module', 'blogroll'); |
| 13 |
|
|
| 14 |
|
|
| 15 |
|
if (!node_get_types('blog_blogroll')){ |
| 16 |
|
include (drupal_get_path('module', 'install_profile_api') . '/contrib/content_copy.inc'); |
| 17 |
|
drupal_set_message("I rule"); |
| 18 |
|
install_content_copy_import_from_file($path .'/blog_blogroll.inc'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
/** |
| 24 |
|
* Implementation of hook_uninstall() |
| 25 |
|
*/ |
| 26 |
|
function blogroll_uninstall() { |
| 27 |
|
$result = db_query("SELECT nid FROM {node} WHERE type IN ('blog_blogroll')"); |
| 28 |
|
while ($node = db_fetch_object($result)) { |
| 29 |
|
node_delete($node->nid); |
| 30 |
|
} |
| 31 |
|
node_type_delete('blog_blogroll'); |
| 32 |
|
|
| 33 |
|
} |