You are here

freelinking.install in Freelinking 6.3

Install, update and uninstall functions for the freelinking module.

File

freelinking.install
View source
<?php

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

/**
 * Implements hook_update_N().
 *
 * Check that plugin freelinking_path.inc has been deleted.
 */
function freelinking_update_6001() {

  // Nothing here.
}

/**
 * Implements hook_update_N().
 *
 * Input formats using Freelinking filters should not be cached.
 */
function freelinking_update_6000() {
  db_query("UPDATE {filter_formats} SET cache=0 WHERE format IN (SELECT format FROM {filters} WHERE module='%s')", array(
    'freelinking',
  ));
}

/**
 * Implements hook_requirements().
 */
function freelinking_requirements($phase) {
  $requirements = array();
  if ('runtime' == $phase) {
    $removed = !file_exists(drupal_get_path('module', 'freelinking') . '/plugins/freelinking_path.inc');
    $sevr = $removed ? REQUIREMENT_OK : REQUIREMENT_ERROR;
    $t = get_t();
    $requirements['freelinking'] = array(
      'title' => $t('Freelinking'),
      'value' => 'Enabled',
      'description' => $t('Please make sure that the file "freelinking_path.inc" is removed from the "plugins" directory.'),
      'severity' => $sevr,
    );
  }
  return $requirements;
}