View source
<?php
require_once __DIR__ . '/fiu.field.inc';
function fiu_theme() {
return [
'fine_image_widget' => [
'render element' => 'element',
'file' => 'fiu.field.inc',
],
'fine_image_widget_unitary' => [
'render element' => 'element',
'file' => 'fiu.field.inc',
],
'fine_image_widget_multiple' => [
'render element' => 'element',
'file' => 'fiu.field.inc',
],
];
}
function fiu_imce_supported_widgets_alter(&$widgets) {
$widgets[] = 'fine_image';
}
function fiu_filefield_sources_widgets() {
return [
'fine_image',
];
}
function fiu_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['filefield_sources_list'])) {
$theme_registry['filefield_sources_list']['function'] = 'fiu_filefield_sources_list';
}
}
function fiu_filefield_sources_list($variables) {
$element = $variables['element'];
$sources = $variables['sources'];
$links = array();
foreach ($sources as $name => $source) {
$links[] = '<a href="#" onclick="return false;" title="' . $source['description'] . '" id="' . $element['#id'] . '-' . $name . '-source" class="filefield-source filefield-source-' . $name . '">' . $source['label'] . '</a>';
}
return '<div class="filefield-sources-list">' . implode('', $links) . '</div>';
}