summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/file/file.module
diff options
context:
space:
mode:
authorhooroomoo <57237-hooroomoo@users.noreply.drupalcode.org>2023-06-30 19:27:14 +0000
committerBen Mullins <5684-bnjmnm@users.noreply.drupalcode.org>2023-06-30 19:27:14 +0000
commit9d522de0543fd8f674873988012994730e403b03 (patch)
treeaef5dc5c100a633c99b07ace2f2793ef81f011ec /core/modules/file/file.module
parent9a66ffcedbcf90e59320b49f44dfeaff8485aa1b (diff)
downloaddrupal-9d522de0543fd8f674873988012994730e403b03.tar.gz
drupal-9d522de0543fd8f674873988012994730e403b03.zip
Issue #3356894 by hooroomoo, lauriii, srishtiiee, Rajeshreeputra, Utkarsh_33, bnjmnm, narendraR, tim.plunkett, smustgrave, ckrina, yoroy, amateescu, Wim Leers: Make field selection less overwhelming by introducing groups
Diffstat (limited to 'core/modules/file/file.module')
-rw-r--r--core/modules/file/file.module20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index a6332db90c7..1fa00345e65 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1552,3 +1552,23 @@ function file_field_find_file_reference_column(FieldDefinitionInterface $field)
}
return FALSE;
}
+
+/**
+ * Implements hook_field_type_category_info().
+ */
+function file_field_type_category_info() {
+ return [
+ 'file_upload' => [
+ 'label' => t('File upload'),
+ 'description' => t('Field to upload any type of files.'),
+ 'weight' => -15,
+ ],
+ ];
+}
+
+/**
+ * Implements hook_preprocess_form_element__new_storage_type().
+ */
+function file_preprocess_form_element__new_storage_type(&$variables) {
+ $variables['#attached']['library'][] = 'file/drupal.file-icon';
+}