File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed
templates/components/form Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change 2828 # along with this program. If not, see <https://www.gnu.org/licenses/>.
2929 #
3030 # ---------------------------------------------------------------------
31- #
32- # --- Usage ---
33- #
34- # This partial provides a reusable file uploader dropzone.
35- # The JS (FileUploader.js) and SCSS (_file-uploader.scss) are already generic;
36- # this Twig layer completes the extraction to make the component fully reusable.
37- #
38- # To use this partial anywhere in GLPI:
39- #
40- # {{ include('components/form/file_uploader.html.twig', {
41- # 'input_id': 'my-upload-input',
42- # }, with_context = false) }}
43- #
44- # <script type="module">
45- # import { FileUploader } from '{{ js_path("js/modules/FileUploader.js") }}';
46- # new FileUploader(document.getElementById('my-container'));
47- # </script>
48- #
49- # Full integration with document creation requires an adapter controller
50- # (see Document/UploadController.js for the KB example).
51- #
52- # Parameters:
53- # - input_id (string) Unique ID for the file input (default: random)
54- # - input_name (string) Name attribute for the input (default: 'files[]')
55- # - multiple (bool) Allow multiple files (default: true)
56- # - title (string) Dropzone title text
57- # - hint (string) Dropzone hint text
58- # - browse_label (string) Browse button label
5931 #}
6032
6133{% set input_id = input_id ?? ' file-uploader-input-' ~ random () %}
You can’t perform that action at this time.
0 commit comments