You are here

enterprise_base.install in Enterprise Base 7

Same filename and directory in other branches
  1. 7.3 enterprise_base.install

Installation code for Advanced Forum.

File

enterprise_base.install
View source
<?php

/**
 * @file
 * Installation code for Advanced Forum.
 */
function enterprise_base_install() {

  // insert day and time custom formats
  $format = array();
  $format['format'] = 'D, F d';
  $format['type'] = 'custom';
  $format['locked'] = 0;
  $format['is_new'] = 1;
  system_date_format_save($format);
  $format = array();
  $format['format'] = 'g:i a';
  $format['type'] = 'custom';
  $format['locked'] = 0;
  $format['is_new'] = 1;
  system_date_format_save($format);
  $format_type = array();
  $format_type['title'] = t('Time');
  $format_type['type'] = 'time';
  $format_type['locked'] = 0;
  $format_type['is_new'] = 1;
  system_date_format_type_save($format_type);
  $format_type = array();
  $format_type['title'] = t('Day');
  $format_type['type'] = 'day';
  $format_type['locked'] = 0;
  $format_type['is_new'] = 1;
  system_date_format_type_save($format_type);

  // set modules system weight so it runs after other modules
  db_query("UPDATE {system} SET weight = 50 WHERE name = 'enterprise_base'");
}

/**
 * Implements hook_init()
 *
 * Probably not the best way of doing this but it was the only way that runs
 * after features have been installed.
 */
function enterprise_base_init() {
  if (!variable_get('enterprise_base_installed', FALSE) && taxonomy_vocabulary_machine_name_load('categories')) {

    // Add in Uncategorized taxonomy term.
    $vocab = taxonomy_vocabulary_machine_name_load('categories');
    $term = new stdClass();
    $term->vid = $vocab->vid;
    $term->name = 'Uncategorized';
    $term->vocabulary_machine_name = 'categories';
    taxonomy_term_save($term);
    variable_set('enterprise_base_installed', TRUE);
  }
}
function enterprise_base_uninstall() {
}

Functions

Namesort descending Description
enterprise_base_init Implements hook_init()
enterprise_base_install @file Installation code for Advanced Forum.
enterprise_base_uninstall