Mercurial > defr > drupal > scald > mee
comparison mee.install @ 14:50a57b1517cb
Fully working MEE, with Ressource Manager & all
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Fri, 18 Sep 2009 15:18:53 +0200 |
| parents | 548f63d8a41b |
| children | 7bb375e191b1 |
comparison
equal
deleted
inserted
replaced
| 13:842d89897cb4 | 14:50a57b1517cb |
|---|---|
| 6 * Implementation of hook_install(). | 6 * Implementation of hook_install(). |
| 7 */ | 7 */ |
| 8 function mee_install() { | 8 function mee_install() { |
| 9 drupal_load('module', 'content'); | 9 drupal_load('module', 'content'); |
| 10 content_notify('install', 'mee'); | 10 content_notify('install', 'mee'); |
| 11 drupal_install_schema('mee'); | |
| 11 } | 12 } |
| 12 | 13 |
| 13 /** | 14 /** |
| 14 * Implementation of hook_uninstall(). | 15 * Implementation of hook_uninstall(). |
| 15 */ | 16 */ |
| 16 function mee_uninstall() { | 17 function mee_uninstall() { |
| 17 drupal_load('module', 'content'); | 18 drupal_load('module', 'content'); |
| 18 content_notify('uninstall', 'mee'); | 19 content_notify('uninstall', 'mee'); |
| 20 drupal_uninstall_schema('mee'); | |
| 19 } | 21 } |
| 20 | 22 |
| 21 /** | 23 /** |
| 22 * Implementation of hook_disable(). | 24 * Implementation of hook_disable(). |
| 23 */ | 25 */ |
| 24 function mee_disable() { | 26 function mee_disable() { |
| 25 drupal_load('module', 'content'); | 27 drupal_load('module', 'content'); |
| 26 content_notify('disable', 'mee'); | 28 content_notify('disable', 'mee'); |
| 27 } | 29 } |
| 30 | |
| 31 /** | |
| 32 * Add separate column for the required status | |
| 33 */ | |
| 34 function mee_update_6001() { | |
| 35 $ret = array(); | |
| 36 switch ($GLOBALS['db_type']) { | |
| 37 case 'mysql': | |
| 38 case 'mysqli': | |
| 39 $ret[] = update_sql("ALTER TABLE {mee_ressources} ADD required INT NOT NULL DEFAULT 0"); | |
| 40 break; | |
| 41 } | |
| 42 return $ret; | |
| 43 } | |
| 44 | |
| 45 | |
| 46 /** | |
| 47 * Implementation of hook_schema(). | |
| 48 */ | |
| 49 function mee_schema() { | |
| 50 $schema['mee_ressources'] = array( | |
| 51 'fields' => array( | |
| 52 'content_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), | |
| 53 'atom_sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), | |
| 54 'field' => array('type' => 'varchar', 'length' => 31, 'not null' => TRUE, 'default' => ''), | |
| 55 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), | |
| 56 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), | |
| 57 ), | |
| 58 'primary key' => array('content_nid', 'atom_sid'), | |
| 59 ); | |
| 60 | |
| 61 return $schema; | |
| 62 } |
