You are here

function bueditor_schema in BUEditor 6

Same name and namespace in other branches
  1. 6.2 bueditor.install \bueditor_schema()
  2. 7 bueditor.install \bueditor_schema()

Implementation of hook_schema().

File

./bueditor.install, line 25

Code

function bueditor_schema() {
  $schema['bueditor_editors'] = array(
    'description' => t('Stores editors and their settings.'),
    'fields' => array(
      'eid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('Primary Key: Unique editor ID.'),
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'Noname',
        'description' => t('The editor name.'),
      ),
      'pages' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('Drupal paths on which the editor is visible.'),
      ),
      'excludes' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('Textarea ids for which the editor is not visible.'),
      ),
      'iconpath' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '%BUEDITOR/icons',
        'description' => t('The directory path where the editor icons reside.'),
      ),
      'librarypath' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '%BUEDITOR/library',
        'description' => t('The directory path where the editor library files reside.'),
      ),
    ),
    'primary key' => array(
      'eid',
    ),
  );
  $schema['bueditor_buttons'] = array(
    'description' => t('Stores buttons of {bueditor_editors}.'),
    'fields' => array(
      'bid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('Primary Key: Unique button ID.'),
      ),
      'eid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The {bueditor_editors}.eid to which the button belongs.'),
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'Notitle',
        'description' => t('The button title.'),
      ),
      'content' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('The button content.'),
      ),
      'icon' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The button icon or caption.'),
      ),
      'accesskey' => array(
        'type' => 'varchar',
        'length' => 1,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The button acceskey.'),
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The button weight that determines the button location in the editor layout.'),
      ),
    ),
    'primary key' => array(
      'bid',
    ),
    'indexes' => array(
      'eid' => array(
        'eid',
      ),
    ),
  );
  return $schema;
}