t('Emergency level'), 'value' => $levels[$current], 'severity' => $current ? REQUIREMENT_INFO : REQUIREMENT_OK, ); } return $requirements; } /** * Implements hook_schema(). */ function emergency_schema() { $schema = array(); // The emergency level definition table. $schema['emergency_level'] = array( 'description' => 'Defines emergency levels.', 'fields' => array( 'type' => array( 'description' => 'The machine-readable name of this level.', 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, ), 'name' => array( 'description' => 'The human-readable name of this level.', 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'translatable' => TRUE, ), 'weight' => array( 'description' => 'The weight of this level in relation to other levels.', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), ), 'primary key' => array('type'), // CTools export definition. 'export' => array( 'key' => 'type', 'key name' => 'Type', 'primary key' => 'type', 'identifier' => 'level', 'default hook' => 'default_emergency_level', 'export type string' => 'export_type_string', 'api' => array( 'owner' => 'emergency', 'api' => 'default_emergency_levels', 'minimum_version' => 1, 'current_version' => 1, ), ), ); // The emergency details table. $schema['emergency'] = array( 'description' => 'Stores the last declaration of each emergency type.', 'fields' => array( 'type' => array( 'description' => 'The {emergency_level}.type of this emergency.', 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, ), 'title' => array( 'description' => 'The title or brief summary of this emergency.', 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', ), 'details' => array( 'description' => 'The details of the emergency.', 'type' => 'text', 'size' => 'big', 'not null' => FALSE, 'translatable' => TRUE, ), 'format' => array( 'description' => 'The {filter_format}.format of the details.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, ), 'start' => array( 'description' => 'The time at which the emergency was declared.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'end' => array( 'description' => 'The scheduled time at which the emergency state will be cancelled.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'additional' => array( 'description' => 'Additional details about the emergency.', 'type' => 'text', 'size' => 'big', 'not null' => FALSE, 'translatable' => TRUE, ), ), 'primary key' => array('type'), ); return $schema; } /** * Add the 'additional' field. */ function emergency_update_7100() { db_add_field('emergency', 'additional', array( 'description' => 'Additional details about the emergency.', 'type' => 'text', 'size' => 'big', 'not null' => FALSE, 'translatable' => TRUE, )); }