You are here

image_resize_filter.install in Image Resize Filter 6

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

File

image_resize_filter.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function image_resize_filter_install() {
  drupal_set_message(t('The image resize filter has been installed. Before this does anything, the image resize filter needs to be added to one or more input formats. Visit the <a href="!url">input format administration</a> to set up this filter.', array(
    '!url' => url('admin/settings/filters'),
  )), 'warning');
}

/**
 * Implementation of hook_uninstall().
 */
function image_resize_filter_uninstall() {
  drupal_load('module', 'image_resize_filter');
  image_resize_filter_delete_all();
  db_query("DELETE FROM {variable} WHERE name LIKE 'input_resize_filter_%'");
}

/**
 * Implementation of hook_requirements().
 */
function image_resize_filter_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'install' && function_exists('image_get_toolkit')) {
    if (!(image_get_toolkit() || function_exists('imageapi_default_toolkit') && imageapi_default_toolkit())) {
      $requirements['image_resize_filter'] = array(
        'title' => $t('Image resize filter'),
        'description' => $t('Image resize filter requires at least one active image toolkit on your server.'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}

/**
 * Remove the old files sub-directory. Paths to resized images are now shorter.
 */
function image_resize_filter_update_6100() {
  $ret = array();
  drupal_load('module', 'image_resize_filter');
  image_resize_filter_delete_all();
  $ret[] = array(
    'success' => TRUE,
    'query' => t('The location of resized images has changed. The currently resized images have been flushed.'),
  );
  return $ret;
}

/**
 * Remove the "Image resize difference" option.
 * It was confusing and didn't actually do anything.
 */
function image_resize_filter_update_6101() {
  $ret = array();
  db_query("DELETE FROM {variable} WHERE name LIKE 'image_resize_filter_allowed_difference_%'");
  $ret[] = array(
    'success' => TRUE,
    'query' => t('Image resize allowed difference option removed.'),
  );
  return $ret;
}

/**
 * Clear out all resized images to give them proper names if they were missing.
 */
function image_resize_filter_update_6102() {
  $ret = array();
  drupal_load('module', 'image_resize_filter');
  image_resize_filter_delete_all();
  $ret[] = array(
    'success' => TRUE,
    'query' => t('Previously resized images may have been missing file names. The currently resized images have been flushed.'),
  );
  return $ret;
}

Functions

Namesort descending Description
image_resize_filter_install Implementation of hook_install().
image_resize_filter_requirements Implementation of hook_requirements().
image_resize_filter_uninstall Implementation of hook_uninstall().
image_resize_filter_update_6100 Remove the old files sub-directory. Paths to resized images are now shorter.
image_resize_filter_update_6101 Remove the "Image resize difference" option. It was confusing and didn't actually do anything.
image_resize_filter_update_6102 Clear out all resized images to give them proper names if they were missing.