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

Contents of /contributions/modules/addnode/addnode.install

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


Revision 1.1 - (show annotations) (download) (as text)
Wed Jul 9 15:43:40 2008 UTC (16 months, 2 weeks ago) by panis
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
refactored addnode - uses popup window to create nodes on the fly.
1 <?php
2
3 /**
4 * hook install for addnode.. create table to store the addnode order
5 */
6 function addnode_install() {
7 switch ($GLOBALS['db_type']) {
8 case 'mysql':
9 case 'mysqli':
10 db_query("CREATE TABLE {addnode_order} (nid int not null default 0, fieldname char(255) not null default '', weights text) /*!40100 DEFAULT CHARACTER SET utf8 */");
11 break;
12 case 'pgsql':
13 db_query("CREATE TABLE {addnode_order} (nid integer not null default 0, fieldname varchar(255) not null default '', weights text)");
14 break;
15 }
16 }
17
18 /**
19 * we are reusing addnode namespace to update function for existing sites.
20 */
21 function addnode_update_1() {
22 $ret = array();
23 addnode_install();
24 return $ret;
25 }
26
27 /**
28 * hook_uninstall deletes the support tables.
29 **/
30 function addnode_uninstall() {
31 db_query("DROP TABLE {addnode_order}");
32 }

  ViewVC Help
Powered by ViewVC 1.1.2