Changeset 42 for trunk/bin/module_maker/form_template.cli.php
- Timestamp:
- Dec 18, 2005 12:16:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r41 r42 40 40 if (is_array($cols) && !empty($cols)) { 41 41 foreach ($cols as $col) { 42 42 43 43 // Human readable. 44 44 $field = $col[0]; … … 48 48 $primary_key_field = $field; 49 49 } 50 50 51 51 // Column types like this are usually single toggle checkboxes. 52 52 if (preg_match("/enum\('true'\)/", $col[1])) { 53 53 $type = 'toggle'; 54 54 } 55 55 56 56 if (in_array($field, $exclude) || $primary_key_field == $field) { 57 57 // Don't add a field for this column. 58 58 continue; 59 59 } 60 60 61 61 // Select menu from the column of a related database table. 62 62 if (preg_match('/.*_id$/i', $field)) { … … 79 79 continue; 80 80 } 81 81 82 82 // File upload. 83 83 if (preg_match('/file|image/i', $field)) { … … 96 96 continue; 97 97 } 98 98 99 99 // Password field. 100 100 if (preg_match('/pass/i', $field)) { … … 109 109 continue; 110 110 } 111 111 112 112 switch ($type) { 113 113 114 114 // Select menu (or radio buttons) 115 115 case 'enum' : … … 125 125 E_O_F; 126 126 break; 127 127 128 128 // Set checkboxes 129 129 case 'set' : … … 137 137 E_O_F; 138 138 break; 139 139 140 140 // Single checkbox 141 141 case 'toggle' : … … 149 149 E_O_F; 150 150 break; 151 151 152 152 // Textarea 153 153 case 'tinytext' : … … 168 168 E_O_F; 169 169 break; 170 171 170 171 172 172 // Text 173 173 case 'tinyint' : … … 179 179 case 'integer' : 180 180 case 'bigint' : 181 181 182 182 case 'float' : 183 183 case 'float' : … … 188 188 case 'dec' : 189 189 case 'numeric' : 190 190 191 191 case 'date' : 192 192 case 'datetime' : … … 194 194 case 'time' : 195 195 case 'year' : 196 196 197 197 case 'char' : 198 198 case 'varchar' :
Note: See TracChangeset
for help on using the changeset viewer.