xbbcode.install in Extensible BBCode 8
Same filename and directory in other branches
Installation actions and database schema.
File
xbbcode.installView source
<?php
/**
* @file
* Installation actions and database schema.
*/
/**
* Implements hook_schema().
*/
function xbbcode_schema() {
$schema['xbbcode_custom_tag'] = array(
'description' => 'Custom tags created manually',
'fields' => array(
// Key
'name' => array(
'description' => 'Identifies the tag, and serves also to recognize it in text',
'type' => 'varchar',
'not null' => TRUE,
'default' => '',
'length' => 32,
),
// Data
'markup' => array(
'description' => 'The markup that this tag should be replaced with when filtering',
'type' => 'text',
'size' => 'normal',
),
'description' => array(
'description' => 'Describes the use of this tag for the help text',
'type' => 'text',
'size' => 'normal',
),
'sample' => array(
'description' => 'A sample of how this tag is to be used',
'type' => 'text',
'size' => 'normal',
),
// Options
'options' => array(
'description' => 'The settings chosen for this tag in serialized form.',
'type' => 'text',
'size' => 'normal',
),
),
'primary key' => array(
'name',
),
);
$schema['xbbcode_handler'] = array(
'description' => 'The module that each tag will be handled by, per-format',
'fields' => array(
// Key
'name' => array(
'description' => 'Identifies the tag, and serves also to recognize it in text',
'type' => 'varchar',
'not null' => TRUE,
'default' => '',
'length' => 32,
),
'format' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'GLOBAL',
'description' => 'Foreign key: The format to which the handler settings belong. GLOBAL for the global settings.',
),
// Options
'module' => array(
'description' => 'The system name of the module that handles this tag',
'type' => 'varchar',
'not null' => TRUE,
'default' => '',
'length' => 32,
),
'enabled' => array(
'description' => 'Whether this tag is currently enabled',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
),
'primary key' => array(
'name',
'format',
),
);
return $schema;
}
Functions
Name![]() |
Description |
---|---|
xbbcode_schema | Implements hook_schema(). |