comparison modules/profile/profile.install @ 19:3edae6ecd6c6 6.9

Drupal 6.9
author Franck Deroche <franck@defr.org>
date Thu, 15 Jan 2009 10:15:56 +0100
parents c1f4ac30525a
children
comparison
equal deleted inserted replaced
18:f5131a9cd9e5 19:3edae6ecd6c6
1 <?php 1 <?php
2 // $Id: profile.install,v 1.12 2007/12/18 12:59:22 dries Exp $ 2 // $Id: profile.install,v 1.12.2.1 2009/01/06 15:46:37 goba Exp $
3 3
4 /** 4 /**
5 * Implementation of hook_install(). 5 * Implementation of hook_install().
6 */ 6 */
7 function profile_install() { 7 function profile_install() {
22 /** 22 /**
23 * Implementation of hook_schema(). 23 * Implementation of hook_schema().
24 */ 24 */
25 function profile_schema() { 25 function profile_schema() {
26 $schema['profile_fields'] = array( 26 $schema['profile_fields'] = array(
27 'description' => t('Stores profile field information.'), 27 'description' => 'Stores profile field information.',
28 'fields' => array( 28 'fields' => array(
29 'fid' => array( 29 'fid' => array(
30 'type' => 'serial', 30 'type' => 'serial',
31 'not null' => TRUE, 31 'not null' => TRUE,
32 'description' => t('Primary Key: Unique profile field ID.'), 32 'description' => 'Primary Key: Unique profile field ID.',
33 ), 33 ),
34 'title' => array( 34 'title' => array(
35 'type' => 'varchar', 35 'type' => 'varchar',
36 'length' => 255, 36 'length' => 255,
37 'not null' => FALSE, 37 'not null' => FALSE,
38 'description' => t('Title of the field shown to the end user.'), 38 'description' => 'Title of the field shown to the end user.',
39 ), 39 ),
40 'name' => array( 40 'name' => array(
41 'type' => 'varchar', 41 'type' => 'varchar',
42 'length' => 128, 42 'length' => 128,
43 'not null' => TRUE, 43 'not null' => TRUE,
44 'default' => '', 44 'default' => '',
45 'description' => t('Internal name of the field used in the form HTML and URLs.'), 45 'description' => 'Internal name of the field used in the form HTML and URLs.',
46 ), 46 ),
47 'explanation' => array( 47 'explanation' => array(
48 'type' => 'text', 48 'type' => 'text',
49 'not null' => FALSE, 49 'not null' => FALSE,
50 'description' => t('Explanation of the field to end users.'), 50 'description' => 'Explanation of the field to end users.',
51 ), 51 ),
52 'category' => array( 52 'category' => array(
53 'type' => 'varchar', 53 'type' => 'varchar',
54 'length' => 255, 54 'length' => 255,
55 'not null' => FALSE, 55 'not null' => FALSE,
56 'description' => t('Profile category that the field will be grouped under.'), 56 'description' => 'Profile category that the field will be grouped under.',
57 ), 57 ),
58 'page' => array( 58 'page' => array(
59 'type' => 'varchar', 59 'type' => 'varchar',
60 'length' => 255, 60 'length' => 255,
61 'not null' => FALSE, 61 'not null' => FALSE,
62 'description' => t("Title of page used for browsing by the field's value"), 62 'description' => "Title of page used for browsing by the field's value",
63 ), 63 ),
64 'type' => array( 64 'type' => array(
65 'type' => 'varchar', 65 'type' => 'varchar',
66 'length' => 128, 66 'length' => 128,
67 'not null' => FALSE, 67 'not null' => FALSE,
68 'description' => t('Type of form field.'), 68 'description' => 'Type of form field.',
69 ), 69 ),
70 'weight' => array( 70 'weight' => array(
71 'type' => 'int', 71 'type' => 'int',
72 'not null' => TRUE, 72 'not null' => TRUE,
73 'default' => 0, 73 'default' => 0,
74 'size' => 'tiny', 74 'size' => 'tiny',
75 'description' => t('Weight of field in relation to other profile fields.'), 75 'description' => 'Weight of field in relation to other profile fields.',
76 ), 76 ),
77 'required' => array( 77 'required' => array(
78 'type' => 'int', 78 'type' => 'int',
79 'not null' => TRUE, 79 'not null' => TRUE,
80 'default' => 0, 80 'default' => 0,
81 'size' => 'tiny', 81 'size' => 'tiny',
82 'description' => t('Whether the user is required to enter a value. (0 = no, 1 = yes)'), 82 'description' => 'Whether the user is required to enter a value. (0 = no, 1 = yes)',
83 ), 83 ),
84 'register' => array( 84 'register' => array(
85 'type' => 'int', 85 'type' => 'int',
86 'not null' => TRUE, 86 'not null' => TRUE,
87 'default' => 0, 87 'default' => 0,
88 'size' => 'tiny', 88 'size' => 'tiny',
89 'description' => t('Whether the field is visible in the user registration form. (1 = yes, 0 = no)'), 89 'description' => 'Whether the field is visible in the user registration form. (1 = yes, 0 = no)',
90 ), 90 ),
91 'visibility' => array( 91 'visibility' => array(
92 'type' => 'int', 92 'type' => 'int',
93 'not null' => TRUE, 93 'not null' => TRUE,
94 'default' => 0, 94 'default' => 0,
95 'size' => 'tiny', 95 'size' => 'tiny',
96 'description' => t('The level of visibility for the field. (0 = hidden, 1 = private, 2 = public on profile but not member list pages, 3 = public on profile and list pages)'), 96 'description' => 'The level of visibility for the field. (0 = hidden, 1 = private, 2 = public on profile but not member list pages, 3 = public on profile and list pages)',
97 ), 97 ),
98 'autocomplete' => array( 98 'autocomplete' => array(
99 'type' => 'int', 99 'type' => 'int',
100 'not null' => TRUE, 100 'not null' => TRUE,
101 'default' => 0, 101 'default' => 0,
102 'size' => 'tiny', 102 'size' => 'tiny',
103 'description' => t('Whether form auto-completion is enabled. (0 = disabled, 1 = enabled)'), 103 'description' => 'Whether form auto-completion is enabled. (0 = disabled, 1 = enabled)',
104 ), 104 ),
105 'options' => array( 105 'options' => array(
106 'type' => 'text', 106 'type' => 'text',
107 'not null' => FALSE, 107 'not null' => FALSE,
108 'description' => t('List of options to be used in a list selection field.'), 108 'description' => 'List of options to be used in a list selection field.',
109 ), 109 ),
110 ), 110 ),
111 'indexes' => array('category' => array('category')), 111 'indexes' => array('category' => array('category')),
112 'unique keys' => array('name' => array('name')), 112 'unique keys' => array('name' => array('name')),
113 'primary key' => array('fid'), 113 'primary key' => array('fid'),
114 ); 114 );
115 115
116 $schema['profile_values'] = array( 116 $schema['profile_values'] = array(
117 'description' => t('Stores values for profile fields.'), 117 'description' => 'Stores values for profile fields.',
118 'fields' => array( 118 'fields' => array(
119 'fid' => array( 119 'fid' => array(
120 'type' => 'int', 120 'type' => 'int',
121 'unsigned' => TRUE, 121 'unsigned' => TRUE,
122 'not null' => TRUE, 122 'not null' => TRUE,
123 'default' => 0, 123 'default' => 0,
124 'description' => t('The {profile_fields}.fid of the field.'), 124 'description' => 'The {profile_fields}.fid of the field.',
125 ), 125 ),
126 'uid' => array( 126 'uid' => array(
127 'type' => 'int', 127 'type' => 'int',
128 'unsigned' => TRUE, 128 'unsigned' => TRUE,
129 'not null' => TRUE, 129 'not null' => TRUE,
130 'default' => 0, 130 'default' => 0,
131 'description' => t('The {users}.uid of the profile user.'), 131 'description' => 'The {users}.uid of the profile user.',
132 ), 132 ),
133 'value' => array( 133 'value' => array(
134 'type' => 'text', 134 'type' => 'text',
135 'not null' => FALSE, 135 'not null' => FALSE,
136 'description' => t('The value for the field.'), 136 'description' => 'The value for the field.',
137 ), 137 ),
138 ), 138 ),
139 'primary key' => array('uid', 'fid'), 139 'primary key' => array('uid', 'fid'),
140 'indexes' => array( 140 'indexes' => array(
141 'fid' => array('fid'), 141 'fid' => array('fid'),