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

Contents of /contributions/modules/dependent/dependent.install

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


Revision 1.2 - (show annotations) (download) (as text)
Sat May 31 18:02:25 2008 UTC (17 months, 3 weeks ago) by levyofi
Branch: MAIN
CVS Tags: DRUPAL-5--1-4-BETA, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +2 -2 lines
File MIME type: text/x-php
adding the possiblity to choose a selection field as a parent field.
fixing issues with link field and other fields without default 'form-item'.
1 <?php
2 // $Id: dependent.install,v 1.1 2008/03/07 09:42:10 levyofi Exp $
3
4 function dependent_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysqli':
7 case 'mysql':
8 case 'pgsql':
9 db_query("CREATE TABLE if not exists {field_dependencies} (
10 parent_field_name varchar(32) NOT NULL,
11 child_field_name varchar(32) NOT NULL,
12 parent_node_type_name varchar(32) NOT NULL,
13 child_node_type_name varchar(32) NOT NULL,
14 option_text varchar(255),
15 put_after_parent boolean default 0,
16 is_required boolean default 0,
17 PRIMARY KEY(parent_field_name,child_field_name,parent_node_type_name,child_node_type_name)
18 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
19 break;
20 default:
21 break;
22 }
23 }
24
25 function dependent_uninstall() {
26 db_query("DROP TABLE {field_dependencies}");
27 }

  ViewVC Help
Powered by ViewVC 1.1.2