View source
<?php
require_once 'includes/managed_file.common.inc';
function managed_file_menu() {
$routes = [];
$routes['managed_file/get_fid_by_uri'] = [
'type' => MENU_CALLBACK,
'file' => 'includes/managed_file.pages.inc',
'page callback' => 'managed_file_get_fid_by_uri',
'access arguments' => [
'access content',
],
];
return $routes;
}
function managed_file_element_info_alter(array &$types) {
$types['managed_file'] += [
'#widget' => FALSE,
'#preview' => TRUE,
'#styles' => FALSE,
];
$types['managed_file']['#default_value_callback'] = $types['managed_file']['#value_callback'];
$types['managed_file']['#value_callback'] = 'managed_file_element_value';
array_unshift($types['managed_file']['#process'], 'managed_file_element_process');
}