| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: simplenews_template.install,v 1.3.2.1 2008/12/05 13:41:22 tobiassjosten Exp $
|
| 4 |
|
| 5 |
|
| 6 |
/**
|
| 7 |
* @file
|
| 8 |
* Installs Simplenews Template.
|
| 9 |
*/
|
| 10 |
|
| 11 |
|
| 12 |
function _simplenews_template_install_db_query($sql) {
|
| 13 |
if (!($result = db_query($sql))) {
|
| 14 |
drupal_set_mesage("Simplenews Template failed to execute following SQL-query: $sql");
|
| 15 |
}
|
| 16 |
return $result;
|
| 17 |
}
|
| 18 |
|
| 19 |
function simplenews_template_install() {
|
| 20 |
// Weight module to be called after Simplenews and Mime Mail
|
| 21 |
db_query("UPDATE {system} SET weight = 1 WHERE name = 'simplenews_template'");
|
| 22 |
}
|
| 23 |
|
| 24 |
function simplenews_template_uninstall() {
|
| 25 |
global $conf;
|
| 26 |
|
| 27 |
// Delete variables.
|
| 28 |
if (!($result = _simplenews_template_install_db_query("SELECT name FROM {variable} WHERE name LIKE 'simplenews_template_%'"))) return;
|
| 29 |
while ($row = db_fetch_array($result)) {
|
| 30 |
unset($conf[$row['name']]);
|
| 31 |
}
|
| 32 |
if (!($result = _simplenews_template_install_db_query("DELETE FROM {variable} WHERE name LIKE 'simplenews_template_%'"))) return;
|
| 33 |
cache_clear_all('variables', 'cache');
|
| 34 |
}
|