From 7d67a6327110058c7364232bbe74ab11e7c2a34d Mon Sep 17 00:00:00 2001 From: Vincent Gao Date: Tue, 8 Aug 2023 09:24:21 +1000 Subject: [PATCH] add new icons --- .../install/views.view.tide_media_browser.yml | 4 +- config/optional/views.view.media.yml | 934 ++++++++++++++++++ css/media_browser.css | 38 +- images/icons/tide_csv.svg | 6 + images/icons/tide_doc.svg | 6 + images/icons/tide_docx.svg | 7 + images/icons/tide_dot.svg | 6 + images/icons/tide_dotm.svg | 7 + images/icons/tide_dotx.svg | 7 + images/icons/tide_pdf.svg | 6 + images/icons/tide_ppt.svg | 10 + images/icons/tide_pptx.svg | 7 + images/icons/tide_tiff.svg | 11 + images/icons/tide_txt.svg | 10 + images/icons/tide_xls.svg | 10 + images/icons/tide_xlsm.svg | 11 + images/icons/tide_xlsx.svg | 11 + images/icons/tide_zip.svg | 10 + tide_media.install | 32 + tide_media.module | 22 +- 20 files changed, 1144 insertions(+), 11 deletions(-) create mode 100644 config/optional/views.view.media.yml create mode 100644 images/icons/tide_csv.svg create mode 100644 images/icons/tide_doc.svg create mode 100644 images/icons/tide_docx.svg create mode 100644 images/icons/tide_dot.svg create mode 100644 images/icons/tide_dotm.svg create mode 100644 images/icons/tide_dotx.svg create mode 100644 images/icons/tide_pdf.svg create mode 100644 images/icons/tide_ppt.svg create mode 100644 images/icons/tide_pptx.svg create mode 100644 images/icons/tide_tiff.svg create mode 100644 images/icons/tide_txt.svg create mode 100644 images/icons/tide_xls.svg create mode 100644 images/icons/tide_xlsm.svg create mode 100644 images/icons/tide_xlsx.svg create mode 100644 images/icons/tide_zip.svg diff --git a/config/install/views.view.tide_media_browser.yml b/config/install/views.view.tide_media_browser.yml index 7aa587a..851b784 100644 --- a/config/install/views.view.tide_media_browser.yml +++ b/config/install/views.view.tide_media_browser.yml @@ -1104,7 +1104,7 @@ display: exclude: false alter: alter_text: true - text: "{% set content_variable = filemime|render|striptags %}\r\n{% if content_variable == 'msword' %}\r\n \r\n{% elseif content_variable == 'pdf' %}\r\n \r\n{% elseif content_variable == 'spreadsheet' %}\r\n \r\n{% elseif content_variable == 'presentation' %}\r\n \r\n{% elseif content_variable == 'plaintext' %}\r\n \r\n{% else %}\r\n {{ thumbnail__target_id }}\r\n{% endif %}" + text: "{% set content_variable = filemime|render|striptags %}\r\n{% if content_variable == 'msword' %}\r\n \r\n{% elseif content_variable == 'pdf' %}\r\n \r\n{% elseif content_variable == 'spreadsheet' %}\r\n \r\n{% elseif content_variable == 'presentation' %}\r\n \r\n{% elseif content_variable == 'plaintext' %}\r\n \r\n{% elseif content_variable == 'xlsm' %}\r\n \r\n{% elseif content_variable == 'csv' %}\r\n \r\n{% elseif content_variable == 'ppt' %}\r\n \r\n{% elseif content_variable == 'mswordx' %}\r\n \r\n{% elseif content_variable == 'tiff' %}\r\n \r\n{% elseif content_variable == 'zip' %}\r\n \r\n{% else %}\r\n {{ thumbnail__target_id }}\r\n{% endif %}" make_link: false path: '' absolute: false @@ -2578,7 +2578,7 @@ display: exclude: false alter: alter_text: true - text: "{% set content_variable = filemime|render|striptags %}\r\n{% if content_variable == 'msword' %}\r\n \r\n{% elseif content_variable == 'pdf' %}\r\n \r\n{% elseif content_variable == 'spreadsheet' %}\r\n \r\n{% elseif content_variable == 'presentation' %}\r\n \r\n{% elseif content_variable == 'plaintext' %}\r\n \r\n{% else %}\r\n {{ thumbnail__target_id }}\r\n{% endif %}" + text: "{% set content_variable = filemime|render|striptags %}\r\n{% if content_variable == 'msword' %}\r\n \r\n{% elseif content_variable == 'pdf' %}\r\n \r\n{% elseif content_variable == 'spreadsheet' %}\r\n \r\n{% elseif content_variable == 'presentation' %}\r\n \r\n{% elseif content_variable == 'plaintext' %}\r\n \r\n{% elseif content_variable == 'xlsm' %}\r\n \r\n{% elseif content_variable == 'csv' %}\r\n \r\n{% elseif content_variable == 'ppt' %}\r\n \r\n{% elseif content_variable == 'mswordx' %}\r\n \r\n{% elseif content_variable == 'tiff' %}\r\n \r\n{% elseif content_variable == 'zip' %}\r\n \r\n{% else %}\r\n {{ thumbnail__target_id }}\r\n{% endif %}" make_link: false path: '' absolute: false diff --git a/config/optional/views.view.media.yml b/config/optional/views.view.media.yml new file mode 100644 index 0000000..edf8eca --- /dev/null +++ b/config/optional/views.view.media.yml @@ -0,0 +1,934 @@ +langcode: en +status: true +dependencies: + config: + - image.style.thumbnail + module: + - file + - media + - svg_image + - user +id: media +label: Media +module: views +description: '' +tag: '' +base_table: media_field_data +base_field: mid +display: + default: + id: default + display_title: Master + display_plugin: default + position: 0 + display_options: + title: Media + fields: + filemime: + id: filemime + table: file_managed + field: filemime + relationship: field_media_file_target_id + group_type: group + admin_label: '' + entity_type: file + entity_field: filemime + plugin_id: field + label: 'File MIME type' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: file_filemime + settings: + link_to_file: false + filemime_image: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + thumbnail__target_id: + id: thumbnail__target_id + table: media_field_data + field: thumbnail__target_id + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: thumbnail + plugin_id: field + label: Thumbnail + exclude: false + alter: + alter_text: true + text: "{% set content_variable = filemime|render|striptags %}\r\n{% if content_variable == 'msword' %}\r\n \r\n{% elseif content_variable == 'pdf' %}\r\n \r\n{% elseif content_variable == 'spreadsheet' %}\r\n \r\n{% elseif content_variable == 'presentation' %}\r\n \r\n{% elseif content_variable == 'plaintext' %}\r\n \r\n{% elseif content_variable == 'xlsm' %}\r\n \r\n{% elseif content_variable == 'csv' %}\r\n \r\n{% elseif content_variable == 'ppt' %}\r\n \r\n{% elseif content_variable == 'mswordx' %}\r\n \r\n{% elseif content_variable == 'tiff' %}\r\n \r\n{% elseif content_variable == 'zip' %}\r\n \r\n{% else %}\r\n {{ thumbnail__target_id }}\r\n{% endif %}" + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: image + settings: + image_link: '' + image_style: thumbnail + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + name: + id: name + table: media_field_data + field: name + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: media + plugin_id: field + label: 'Media name' + exclude: false + alter: + alter_text: false + make_link: false + absolute: false + word_boundary: false + ellipsis: false + strip_tags: false + trim: false + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + bundle: + id: bundle + table: media_field_data + field: bundle + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: bundle + plugin_id: field + label: Type + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: false + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + uid: + id: uid + table: media_field_data + field: uid + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: uid + plugin_id: field + label: Author + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + status: + id: status + table: media_field_data + field: status + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: status + plugin_id: field + label: Status + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: boolean + settings: + format: custom + format_custom_false: Unpublished + format_custom_true: Published + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + changed: + id: changed + table: media_field_data + field: changed + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: changed + plugin_id: field + label: Updated + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: timestamp + settings: + date_format: custom + custom_date_format: 'd/m/Y - H:i' + timezone: '' + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + operations: + id: operations + table: media + field: operations + relationship: none + group_type: group + admin_label: '' + entity_type: media + plugin_id: entity_operations + label: Operations + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + destination: true + pager: + type: full + options: + offset: 0 + items_per_page: 50 + total_pages: null + id: 0 + tags: + next: 'Next ›' + previous: '‹ Previous' + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + exposed_form: + type: basic + options: + submit_button: Filter + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access media overview' + cache: + type: tag + options: { } + empty: + area_text_custom: + id: area_text_custom + table: views + field: area_text_custom + relationship: none + group_type: group + admin_label: '' + plugin_id: text_custom + empty: true + content: 'No content available.' + tokenize: false + sorts: + created: + id: created + table: media_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: created + plugin_id: date + order: DESC + expose: + label: '' + field_identifier: created + exposed: false + granularity: second + arguments: { } + filters: + name: + id: name + table: media_field_data + field: name + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: name + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: name_op + label: 'Media name' + description: '' + use_operator: false + operator: name_op + operator_limit_selection: false + operator_list: { } + identifier: name + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + bundle: + id: bundle + table: media_field_data + field: bundle + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: bundle + plugin_id: bundle + operator: in + value: { } + group: 1 + exposed: true + expose: + operator_id: bundle_op + label: Type + description: '' + use_operator: false + operator: bundle_op + operator_limit_selection: false + operator_list: { } + identifier: type + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + status: + id: status + table: media_field_data + field: status + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: status + plugin_id: boolean + operator: '=' + value: '1' + group: 1 + exposed: true + expose: + operator_id: '' + label: 'True' + description: null + use_operator: false + operator: status_op + operator_limit_selection: false + operator_list: { } + identifier: status + required: true + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: true + group_info: + label: 'Published status' + description: '' + identifier: status + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: + 1: + title: Published + operator: '=' + value: '1' + 2: + title: Unpublished + operator: '=' + value: '0' + langcode: + id: langcode + table: media_field_data + field: langcode + relationship: none + group_type: group + admin_label: '' + entity_type: media + entity_field: langcode + plugin_id: language + operator: in + value: { } + group: 1 + exposed: true + expose: + operator_id: langcode_op + label: Language + description: '' + use_operator: false + operator: langcode_op + operator_limit_selection: false + operator_list: { } + identifier: langcode + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + status_extra: + id: status_extra + table: media_field_data + field: status_extra + relationship: none + group_type: group + admin_label: '' + entity_type: media + plugin_id: media_status + operator: '=' + value: '' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + columns: + name: name + bundle: bundle + changed: changed + uid: uid + status: status + thumbnail__target_id: thumbnail__target_id + default: changed + info: + name: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + bundle: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + changed: + sortable: true + default_sort_order: desc + align: '' + separator: '' + empty_column: false + responsive: '' + uid: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + status: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + thumbnail__target_id: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + override: true + sticky: false + summary: '' + empty_table: true + caption: '' + description: '' + row: + type: fields + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + replica: false + query_tags: { } + relationships: + field_media_file_target_id: + id: field_media_file_target_id + table: media__field_media_file + field: field_media_file_target_id + relationship: none + group_type: group + admin_label: 'file from field_media_file' + plugin_id: standard + required: false + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user + - user.permissions + tags: { } + media_page_list: + id: media_page_list + display_title: Media + display_plugin: page + position: 1 + display_options: + display_description: '' + display_extenders: { } + path: admin/content/media + menu: + type: tab + title: Media + description: '' + weight: 0 + expanded: false + menu_name: main + parent: '' + context: '0' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user + - user.permissions + tags: { } diff --git a/css/media_browser.css b/css/media_browser.css index 0ec33df..b7fd959 100644 --- a/css/media_browser.css +++ b/css/media_browser.css @@ -1,30 +1,54 @@ .file--tide-media-office-document { - background-image: url(../images/icons/files_docx.svg); + background-image: url(../images/icons/tide_doc.svg); } .file--tide-media-application-pdf { - background-image: url(../images/icons/files_pdf.svg); + background-image: url(../images/icons/tide_pdf.svg); } .file--tide-media-application-spreadsheet { - background-image: url(../images/icons/files_xls.svg); + background-image: url(../images/icons/tide_xls.svg); } .file--tide-media-application-presentation { - background-image: url(../images/icons/files_ppt.svg); + background-image: url(../images/icons/tide_pptx.svg); } .file--tide-media-application-plaintext { - background-image: url(../images/icons/files_txt.svg); + background-image: url(../images/icons/tide_txt.svg); +} + +.file--tide-media-xlsm { + background-image: url(../images/icons/tide_xlsm.svg); +} + +.file--tide-media-csv { + background-image: url(../images/icons/tide_csv.svg); +} + +.file--tide-media-ppt { + background-image: url(../images/icons/tide_ppt.svg); +} + +.file--tide-media-mswordx { + background-image: url(../images/icons/tide_docx.svg); +} + +.file--tide-media-tiff { + background-image: url(../images/icons/tide_tiff.svg); +} + +.file--tide-media-zip { + background-image: url(../images/icons/tide_zip.svg); } .file--tide-media-office-document, .file--tide-media-application-pdf, .file--tide-media-application-spreadsheet, .file--tide-media-application-presentation, -.file--tide-media-application-plaintext { +.file--tide-media-application-plaintext, .file--tide-media-xlsm, .file--tide-media-csv, .file--tide-media-ppt, .file--tide-media-mswordx, .file--tide-media-tiff, .file--tide-media-zip { background-size: 100%; background-repeat: no-repeat; background-position: center; height: 6.25rem; width: 6.25rem; display: block; -} \ No newline at end of file +} diff --git a/images/icons/tide_csv.svg b/images/icons/tide_csv.svg new file mode 100644 index 0000000..754a8d0 --- /dev/null +++ b/images/icons/tide_csv.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/images/icons/tide_doc.svg b/images/icons/tide_doc.svg new file mode 100644 index 0000000..a52ae88 --- /dev/null +++ b/images/icons/tide_doc.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/images/icons/tide_docx.svg b/images/icons/tide_docx.svg new file mode 100644 index 0000000..10238be --- /dev/null +++ b/images/icons/tide_docx.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/images/icons/tide_dot.svg b/images/icons/tide_dot.svg new file mode 100644 index 0000000..18ebe9d --- /dev/null +++ b/images/icons/tide_dot.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/images/icons/tide_dotm.svg b/images/icons/tide_dotm.svg new file mode 100644 index 0000000..21f0e5b --- /dev/null +++ b/images/icons/tide_dotm.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/images/icons/tide_dotx.svg b/images/icons/tide_dotx.svg new file mode 100644 index 0000000..514f81d --- /dev/null +++ b/images/icons/tide_dotx.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/images/icons/tide_pdf.svg b/images/icons/tide_pdf.svg new file mode 100644 index 0000000..c9d4709 --- /dev/null +++ b/images/icons/tide_pdf.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/images/icons/tide_ppt.svg b/images/icons/tide_ppt.svg new file mode 100644 index 0000000..e22db40 --- /dev/null +++ b/images/icons/tide_ppt.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/icons/tide_pptx.svg b/images/icons/tide_pptx.svg new file mode 100644 index 0000000..3a39a35 --- /dev/null +++ b/images/icons/tide_pptx.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/images/icons/tide_tiff.svg b/images/icons/tide_tiff.svg new file mode 100644 index 0000000..eab3822 --- /dev/null +++ b/images/icons/tide_tiff.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/images/icons/tide_txt.svg b/images/icons/tide_txt.svg new file mode 100644 index 0000000..e6ee8a1 --- /dev/null +++ b/images/icons/tide_txt.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/icons/tide_xls.svg b/images/icons/tide_xls.svg new file mode 100644 index 0000000..ffb6865 --- /dev/null +++ b/images/icons/tide_xls.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/icons/tide_xlsm.svg b/images/icons/tide_xlsm.svg new file mode 100644 index 0000000..a94a1d6 --- /dev/null +++ b/images/icons/tide_xlsm.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/images/icons/tide_xlsx.svg b/images/icons/tide_xlsx.svg new file mode 100644 index 0000000..33d8b89 --- /dev/null +++ b/images/icons/tide_xlsx.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/images/icons/tide_zip.svg b/images/icons/tide_zip.svg new file mode 100644 index 0000000..281ed5e --- /dev/null +++ b/images/icons/tide_zip.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tide_media.install b/tide_media.install index 0d53e4f..f0c7c40 100644 --- a/tide_media.install +++ b/tide_media.install @@ -871,3 +871,35 @@ function tide_media_update_8046() { } } } + +/** + * Update views.view.tide_media_browser. + */ +function tide_media_update_8047() { + \Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/helpers'); + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_media') . '/config/install']; + $storage = \Drupal::entityTypeManager()->getStorage('view'); + $config_entity = $storage->load('tide_media_browser'); + if ($config_entity !== NULL) { + $storage->delete([$config_entity]); + } + $config_read = _tide_read_config('views.view.tide_media_browser', $config_location, FALSE); + $new_config_entity = $storage->createFromStorageRecord($config_read); + $new_config_entity->save(); +} + +/** + * Update views.view.media. + */ +function tide_media_update_8048() { + \Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/helpers'); + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_media') . '/config/optional']; + $storage = \Drupal::entityTypeManager()->getStorage('view'); + $config_entity = $storage->load('media'); + if ($config_entity !== NULL) { + $storage->delete([$config_entity]); + } + $config_read = _tide_read_config('views.view.media', $config_location, FALSE); + $new_config_entity = $storage->createFromStorageRecord($config_read); + $new_config_entity->save(); +} diff --git a/tide_media.module b/tide_media.module index 7417dca..7be2e43 100644 --- a/tide_media.module +++ b/tide_media.module @@ -301,7 +301,7 @@ function tide_media_preprocess_image(&$variables) { * Implements hook_views_pre_render(). */ function tide_media_views_pre_render(ViewExecutable $view) { - if ($view->id() === 'tide_media_browser' && (($view->current_display === 'media_browser') || ($view->current_display === 'document_browser'))) { + if (($view->id() === 'tide_media_browser' || $view->id() === 'media') && ($view->current_display === 'media_browser' || $view->current_display === 'document_browser' || $view->current_display === 'media_page_list')) { $view->element['#attached']['library'][] = 'tide_media/media_browser'; $view->element['#attached']['library'][] = 'tide_media/embed_media_iframe_form'; foreach ($view->result as $value) { @@ -312,6 +312,9 @@ function tide_media_views_pre_render(ViewExecutable $view) { if (strpos($file_mime, 'msword') || strpos($file_mime, 'wordprocessingml.document')) { $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'msword'); } + if (strpos($file_mime, 'wordprocessingml.document')) { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'mswordx'); + } if (strpos($file_mime, 'pdf')) { $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'pdf'); } @@ -321,9 +324,24 @@ function tide_media_views_pre_render(ViewExecutable $view) { if (strpos($file_mime, 'presentation')) { $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'presentation'); } - if (strpos($file_mime, 'text/plain')) { + if ($file_mime == 'text/plain') { $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'plaintext'); } + if ($file_mime == 'application/vnd.ms-excel.sheet.macroEnabled.12') { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'xlsm'); + } + if ($file_mime == 'text/csv') { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'csv'); + } + if ($file_mime == 'application/vnd.ms-powerpoint') { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'ppt'); + } + if ($file_mime == 'image/tiff') { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'tiff'); + } + if ($file_mime == 'application/zip') { + $value->_relationship_entities['field_media_file_target_id']->set('filemime', 'zip'); + } } } }