You are here

photobox.install in PhotoboxPhotobox 7

Install, update and uninstall functions for the Photobox module.

File

photobox.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Photobox module.
 */

/**
 * Implements hook_install().
 */
function photobox_install() {
}

/**
 * Implements hook_uninstall().
 */
function photobox_uninstall() {
  variable_del('photobox_library_path');
  module_load_include('module', 'photobox');
  foreach (_photobox_settings() as $key => $setting) {
    variable_del('photobox_' . $key);
  }
}

/**
 * Implements hook_requirements().
 */
function photobox_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if ($phase == 'runtime') {
    if ($photobox_version = _photobox_library_version()) {
      $requirements['photobox'] = array(
        'title' => $t('Photobox library'),
        'value' => $photobox_version,
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['photobox'] = array(
        'title' => $t('Photobox library'),
        'value' => $t('Photobox library is missing'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}

Functions