You are here

epub.install in Epub 6

Same filename and directory in other branches
  1. 8 epub.install
  2. 7 epub.install

ePub module' s installation file.

File

epub.install
View source
<?php

/**
 * @file
 * ePub module' s installation file.
 */

/**
 * Implementation of hook_install().
 */
function epub_install() {

  // Create tables.
  drupal_install_schema('epub');
  drupal_set_message(t('ePub settings are available here: <a href="@settings">Administer > Content management > ePubs</a>.', array(
    '@settings' => url('admin/content/epub/settings'),
  )));
  drupal_set_message(t('Also do not forget to check permissions for ePub contents: <a href="@permissions">Administer > User management > Permissions</a>.', array(
    '@permissions' => url('admin/user/permissions'),
  )));
}

/**
 * Implementation of hook_uninstall().
 */
function epub_uninstall() {
  variable_del('epub_custom_chapter_size');
  drupal_uninstall_schema('epub');
}

/**
 * Implementation of hook_schema().
 */
function epub_schema() {
  $schema['epub'] = array(
    'description' => 'Allows the user to download the ePub conversion for a "book" content',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The ePub' s page {node}.nid.",
      ),
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The ePub' s page {node}.vid.",
      ),
      'bid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The book outline the ePub is connected to.",
      ),
      'author_name' => array(
        'type' => 'varchar',
        'length' => 127,
        'description' => 'Name of the person who has written the book.',
      ),
      'language_code' => array(
        'type' => 'varchar',
        'length' => 2,
        'description' => 'RFC3066 Language codes, such as "en", "da", "fr", ...',
      ),
      'identifier' => array(
        'type' => 'text',
        'description' => "The ePub' s ISBN number, preferred for published books, or a UUID.",
      ),
      'identifier_type' => array(
        'type' => 'text',
        'description' => "The ePub' s identifier type, ie: ISBN, ISSN, UUID, ...",
      ),
      'creation_date' => array(
        'type' => 'datetime',
        'not null' => TRUE,
        'description' => "Date in which the ePub was created.",
      ),
      'publisher_name' => array(
        'type' => 'text',
        'description' => 'Name of the person or the company who is publishing the book.',
      ),
      'publisher_site' => array(
        'type' => 'text',
        'description' => 'Site of the person or the company who is publishing the book.',
      ),
      'rights' => array(
        'type' => 'text',
        'description' => 'Copyright and license information specific for the ePub.',
      ),
      'source_url' => array(
        'type' => 'text',
        'description' => 'URL where you will find the ePub',
      ),
    ),
    'primary key' => array(
      'nid',
      'vid',
    ),
    'indexes' => array(
      'bid' => array(
        'bid',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
epub_install Implementation of hook_install().
epub_schema Implementation of hook_schema().
epub_uninstall Implementation of hook_uninstall().