23 $crop_input = (array)
get_input(
'_entity_edit_icon_crop');
24 if (empty($crop_input)) {
74 $current =
$entity->getIconCoordinates($icon_type);
76 $input_cropping_coords = [
83 $diff = array_diff_assoc($input_cropping_coords, $current);
90 $master =
$entity->getIcon(
'master', $icon_type);
93 $tmp_file = new \ElggTempFile();
94 $tmp_file->open(
'write');
95 $tmp_file->write($master->grabFile());
99 'name' => basename($master->getFilenameOnFilestore()),
100 'type' => $master->getMimeType(),
101 'size' => $master->getSize(),
102 'tmp_name' => $tmp_file->getFilenameOnFilestore(),
103 'error' => UPLOAD_ERR_OK,
113 $filebag->set($input_name, $uploaded_file);
125 if (!is_array($file_data)) {
129 $req_fields = [
'error',
'name',
'size',
'tmp_name',
'type'];
130 $keys = array_keys($file_data);
133 if (
$keys !== $req_fields) {
137 return new UploadedFile(
138 $file_data[
'tmp_name'],
elgg_get_uploaded_file(string $input_name, bool $check_for_validity=true)
Returns a single valid uploaded file object.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
arrayToUploadedFile($file_data)
convert $_FILES array to UploadedFile
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
__invoke(\Elgg\Event $event)
Set inputs required to support cropping an existing icon.
get_entity(int $guid)
Loads and returns an entity object from a guid.
_elgg_services()
Get the global service provider.
prepareUpload(int $entity_guid, string $input_name, string $icon_type)
Prepare a single existing icon for cropping.
Generic action listener to support cropping an existing icon.
Models an event passed to event handlers.