/[drupal]/contributions/modules/mysite/mysite_icon/mysite_icon.install
ViewVC logotype

Diff of /contributions/modules/mysite/mysite_icon/mysite_icon.install

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

revision 1.2, Sat Dec 22 18:04:09 2007 UTC revision 1.3, Sun Apr 6 23:08:26 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: mysite_icon.install,v 1.1 2007/10/21 16:31:10 agentken Exp $  // $Id: mysite_icon.install,v 1.2 2007/12/22 18:04:09 agentken Exp $
3    
4  /**  /**
5   * Implementation of hook_install()   * Implementation of hook_install()
# Line 23  function mysite_icon_install() { Line 23  function mysite_icon_install() {
23        db_query($sql);        db_query($sql);
24        $success = TRUE;        $success = TRUE;
25        break;        break;
26    
27      case 'pgsql':      case 'pgsql':
28        $sql = "CREATE TABLE {mysite_icon} (        $sql = "CREATE TABLE {mysite_icon} (
29          iid integer NOT NULL default '0',          iid integer NOT NULL default '0',
# Line 31  function mysite_icon_install() { Line 31  function mysite_icon_install() {
31          type_id integer NOT NULL default '0',          type_id integer NOT NULL default '0',
32          icon varchar(80) NOT NULL default '',          icon varchar(80) NOT NULL default '',
33          PRIMARY KEY (iid),          PRIMARY KEY (iid),
34          UNIQUE (icon)          UNIQUE (icon)
35        )";        )";
36        db_query($sql);        db_query($sql);
37        db_query("CREATE INDEX {mysite_icon}_type_idx ON {mysite_data} (type)");        db_query("CREATE INDEX {mysite_icon}_type_idx ON {mysite_data} (type)");
# Line 40  function mysite_icon_install() { Line 40  function mysite_icon_install() {
40        break;        break;
41    }    }
42    if ($success) {    if ($success) {
43       drupal_set_message(t('MySite Icons module installed successfully.'));      drupal_set_message(t('MySite Icons module installed successfully.'));
44    }    }
45    else {    else {
46      drupal_set_message(t('The installation of the MySite Icons module was unsuccessful.'), 'error');      drupal_set_message(t('The installation of the MySite Icons module was unsuccessful.'), 'error');
47    }    }
48  }  }
49    
50  /**  /**
51   * Implementation of hook_uninstall().   * Implementation of hook_uninstall().
# Line 64  function mysite_icon_uninstall() { Line 64  function mysite_icon_uninstall() {
64    foreach ($variables as $var) {    foreach ($variables as $var) {
65      variable_del($var);      variable_del($var);
66    }    }
67    
68    // Remove any uploaded icons.    // Remove any uploaded icons.
69    $path = variable_get('mysite_icon_path', 'files/mysite');    $path = variable_get('mysite_icon_path', 'files/mysite');
70    $delete = file_scan_directory($path, '.+');    $delete = file_scan_directory($path, '.+');

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2