| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Implementation of hook_install(). 4 */ 5 function form_manager_install() { 6 drupal_install_schema('form_manager'); 7 8 // Need to alter {form_builder_cache} to change data to a mediumblob from a blob (with a 64k size) limit. 9 db_change_field($ret, 'form_builder_cache', 'data', 'data', array('type' => 'blob', 'size' => 'big')); 10 } 11 12 13 /** 14 * Implementation of hook_uninstall(). 15 */ 16 function form_manager_uninstall() { 17 drupal_uninstall_schema('form_manager'); 18 $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'form_manager_%'"); 19 while ($row = db_fetch_object($result)) { 20 variable_del($row->name); 21 } 22 } 23 24 25 /** 26 * Implementation of hook_schema(). 27 */ 28 function form_manager_schema() { 29 $schema = array(); 30 31 $schema['form_manager_forms'] = array( 32 'fields' => array( 33 'fid' => array( 34 'type' => 'serial', 35 'unsigned' => TRUE, 36 'not null' => TRUE, 37 ), 38 'form_id' => array( 39 'type' => 'varchar', 40 'length' => '32', 41 'not null' => FALSE, 42 ), 43 'type' => array( 44 'type' => 'varchar', 45 'length' => '32', 46 'not null' => FALSE, 47 ), 48 'path' => array( 49 'type' => 'varchar', 50 'length' => '64', 51 'not null' => FALSE, 52 ), 53 'status' => array( 54 'description' => 'Boolean indicating whether the form is published (visible to non-administrators).', 55 'type' => 'int', 56 'not null' => TRUE, 57 'default' => 1, 58 'size' => 'tiny', 59 ), 60 'multistep' => array( 61 'description' => 'Boolean indicating whether the form should be treated as a multi-step form based on fieldsets).', 62 'type' => 'int', 63 'not null' => TRUE, 64 'default' => 1, 65 'size' => 'tiny', 66 ), 67 'updated' => array( 68 'type' => 'int', 69 'unsigned' => TRUE, 70 'not null' => TRUE, 71 'default' => 0, 72 'disp-width' => '10', 73 ), 74 'data' => array( 75 'type' => 'text', 76 'size' => 'medium', 77 'not null' => FALSE, 78 ), 79 ), 80 'export' => array( 81 'key' => 'fid', 82 'identifier' => 'formmanager', 83 'default hook' => 'form_manager_formmanager', // Function hook name. 84 'api' => array( 85 'owner' => 'form_manager', 86 'api' => 'form_manager_formmanager', // Base name for api include files. 87 'minimum_version' => 1, 88 'current_version' => 1, 89 ), 90 ), 91 'primary key' => array('fid'), 92 'unique keys' => array( 93 'form_id' => array('form_id'), 94 ), 95 'indexes' => array( 96 'name' => array('form_id'), 97 'obj_name' => array('type', 'form_id'), 98 'updated' => array('updated'), 99 ), 100 ); 101 102 $schema['form_manager_settings'] = array( 103 'fields' => array( 104 'sid' => array( 105 'type' => 'serial', 106 'unsigned' => TRUE, 107 'not null' => TRUE, 108 ), 109 'form_id' => array( 110 'type' => 'varchar', 111 'length' => '32', 112 'not null' => FALSE, 113 ), 114 'path' => array( 115 'type' => 'varchar', 116 'length' => '64', 117 'not null' => FALSE, 118 ), 119 'status' => array( 120 'description' => 'Boolean indicating whether the form is published (visible to non-administrators).', 121 'type' => 'int', 122 'not null' => TRUE, 123 'default' => 1, 124 'size' => 'tiny', 125 ), 126 'multistep' => array( 127 'description' => 'Boolean indicating whether the form should be treated as a multi-step form based on fieldsets).', 128 'type' => 'int', 129 'not null' => TRUE, 130 'default' => 1, 131 'size' => 'tiny', 132 ), 133 'updated' => array( 134 'type' => 'int', 135 'unsigned' => TRUE, 136 'not null' => TRUE, 137 'default' => 0, 138 'disp-width' => '10', 139 ), 140 ), 141 'primary key' => array('sid'), 142 'unique keys' => array( 143 'form_id' => array('form_id'), 144 ), 145 'indexes' => array( 146 'name' => array('form_id'), 147 'updated' => array('updated'), 148 ), 149 ); 150 151 return $schema; 152 } 153
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |