function imagefield_tokens_imce_supported_widgets_alter in ImageField Tokens 8.2
Implements hook_imce_supported_widgets_alter().
If Imce module installed and enabled. If Imce & ImageWidgetCrop modules both installed and enabled.
File
- ./
imagefield_tokens.module, line 60 - Contains functions related to the module functionality and Drupal hooks.
Code
function imagefield_tokens_imce_supported_widgets_alter(&$widgets) {
$moduleHandler = \Drupal::service('module_handler');
if ($moduleHandler
->moduleExists('imce')) {
$widgets[] = 'imagefield_tokens';
if ($moduleHandler
->moduleExists('image_widget_crop')) {
$widgets[] = 'imagefield_tokens_widget_crop';
}
}
}