/[drupal]/contributions/modules/simplenews_template/simplenews_template.install
ViewVC logotype

Contents of /contributions/modules/simplenews_template/simplenews_template.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Mon Feb 2 09:07:23 2009 UTC (9 months, 3 weeks ago) by tbarregren
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +17 -14 lines
File MIME type: text/x-php
Brought HEAD up to date.
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 }

  ViewVC Help
Powered by ViewVC 1.1.2