You are here

filefield_sources.install in FileField Sources 8

Same filename and directory in other branches
  1. 6 filefield_sources.install
  2. 7 filefield_sources.install

Update and install functions for FileField Sources.

File

filefield_sources.install
View source
<?php

/**
 * @file
 * Update and install functions for FileField Sources.
 */

/**
 * Implements hook_install().
 */
function filefield_sources_install() {

  // FileField Sources needs to load after both ImageField and FileField.
  try {
    $file_weight = module_get_weight('file');
    $image_weight = module_get_weight('image');
    $weight = max([
      $file_weight,
      $image_weight,
    ]);
    $weight++;
  } catch (Exception $e) {
    $weight = 5;
  }
  module_set_weight('filefield_sources', $weight);
}

Functions

Namesort descending Description
filefield_sources_install Implements hook_install().