You are here

forena.install in Forena Reports 7.5

Installation api for module

File

forena.install
View source
<?php

// $Id$

/**
 * @file
 * Installation api for module
 */

/**
 * Implementation of hook_schema
 *
 * @return unknown
 */
function forena_schema() {
  $schema['forena_repositories'] = array(
    'fields' => array(
      'repository' => array(
        'type' => 'varchar',
        'length' => '63',
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => '63',
      ),
      'enabled' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'config' => array(
        'type' => 'text',
      ),
    ),
    'primary_key' => array(
      'repository',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook uninstall
 */
function forena_uninstall() {

  // Delete all variables.
  variable_del('forena_default_form');
  variable_del('forena_doc_defaults');
  variable_del('forena_doc_formats');
  variable_del('forena_default_formats');
  variable_del('forena_email_override');
  variable_del('forena_input_format');
  variable_del('forena_last_report_path');
  variable_del('forena_report_repos');
  variable_del('forena_skins');
}

/**
 * Check that the xautoload module has been enabled.
 */
function forena_update_7501() {
  $enabled = module_enable(array(
    'xautoload',
  ));
  if (!$enabled) {
    throw new DrupalUpdateException('X Autoload module (xautoload) required.');
  }
}

/**
 * Check that the ctools mdodule has been enabled.
 */
function forena_update_7502() {
  $enabled = module_enable(array(
    'ctools',
  ));
  if (!$enabled) {
    throw new DrupalUpdateException('Chaos Tools module (ctools) required.');
  }
}

Functions

Namesort descending Description
forena_schema Implementation of hook_schema
forena_uninstall Implementation of hook uninstall
forena_update_7501 Check that the xautoload module has been enabled.
forena_update_7502 Check that the ctools mdodule has been enabled.