| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
* Display a welcome message with link to get started.
|
| 7 |
*/
|
| 8 |
function teaserbytype_install() {
|
| 9 |
drupal_set_message(t('Teaser by Content Type is now installed. Further information is on the <a href="@our-help-page">help page</a>.',
|
| 10 |
array( '@our-help-page' => url('admin/help/teaserbytype') )
|
| 11 |
));
|
| 12 |
}
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Implementation of hook_uninstall().
|
| 16 |
* Remove the persistent variables this module created.
|
| 17 |
*/
|
| 18 |
function teaserbytype_uninstall() {
|
| 19 |
// remove all variables we created
|
| 20 |
// note: potential for cruft here,
|
| 21 |
// as if the user installs a content type-providing module,
|
| 22 |
// then sets the teaser length for it
|
| 23 |
// then uninstalls that module,
|
| 24 |
// then uninstalls this,
|
| 25 |
// the variable for that now defunct content type still exists here
|
| 26 |
// suggestions on how to cleanly fix this welcome
|
| 27 |
// as killing /teaser_length_.+/ seems overkill
|
| 28 |
$types = node_get_types();
|
| 29 |
foreach ($types as $type => $value) {
|
| 30 |
variable_del("teaser_length_$type");
|
| 31 |
}
|
| 32 |
}
|