diff --git a/config/custom/workflows.workflow.uw_workflow.yml b/config/custom/workflows.workflow.uw_workflow.yml new file mode 100644 index 0000000000000000000000000000000000000000..9c5401754d62843f3cf6d6dce872010d6ca07085 --- /dev/null +++ b/config/custom/workflows.workflow.uw_workflow.yml @@ -0,0 +1,181 @@ +langcode: en +status: true +dependencies: + config: + - bibcite_entity.bibcite_reference_type.artwork + - bibcite_entity.bibcite_reference_type.audiovisual + - bibcite_entity.bibcite_reference_type.bill + - bibcite_entity.bibcite_reference_type.book + - bibcite_entity.bibcite_reference_type.book_chapter + - bibcite_entity.bibcite_reference_type.broadcast + - bibcite_entity.bibcite_reference_type.case + - bibcite_entity.bibcite_reference_type.chart + - bibcite_entity.bibcite_reference_type.classical + - bibcite_entity.bibcite_reference_type.conference_paper + - bibcite_entity.bibcite_reference_type.conference_proceedings + - bibcite_entity.bibcite_reference_type.database + - bibcite_entity.bibcite_reference_type.film + - bibcite_entity.bibcite_reference_type.government_report + - bibcite_entity.bibcite_reference_type.hearing + - bibcite_entity.bibcite_reference_type.journal + - bibcite_entity.bibcite_reference_type.journal_article + - bibcite_entity.bibcite_reference_type.legal_ruling + - bibcite_entity.bibcite_reference_type.magazine_article + - bibcite_entity.bibcite_reference_type.manuscript + - bibcite_entity.bibcite_reference_type.map + - bibcite_entity.bibcite_reference_type.miscellaneous + - bibcite_entity.bibcite_reference_type.miscellaneous_section + - bibcite_entity.bibcite_reference_type.newspaper_article + - bibcite_entity.bibcite_reference_type.patent + - bibcite_entity.bibcite_reference_type.personal + - bibcite_entity.bibcite_reference_type.presentation + - bibcite_entity.bibcite_reference_type.report + - bibcite_entity.bibcite_reference_type.software + - bibcite_entity.bibcite_reference_type.statute + - bibcite_entity.bibcite_reference_type.thesis + - bibcite_entity.bibcite_reference_type.unpublished + - bibcite_entity.bibcite_reference_type.web_article + - bibcite_entity.bibcite_reference_type.web_project_page + - bibcite_entity.bibcite_reference_type.web_service + - bibcite_entity.bibcite_reference_type.website + - node.type.uw_ct_blog + - node.type.uw_ct_catalog_item + - node.type.uw_ct_contact + - node.type.uw_ct_event + - node.type.uw_ct_expand_collapse_group + - node.type.uw_ct_news_item + - node.type.uw_ct_opportunity + - node.type.uw_ct_profile + - node.type.uw_ct_project + - node.type.uw_ct_service + - node.type.uw_ct_sidebar + - node.type.uw_ct_site_footer + - node.type.uw_ct_web_page + module: + - content_moderation +id: uw_workflow +label: 'UW workflow' +type: content_moderation +type_settings: + states: + draft: + label: Draft + weight: -10 + published: false + default_revision: false + published: + label: Published + weight: -10 + published: true + default_revision: true + uw_wf_archived: + label: Archived + weight: -10 + published: false + default_revision: true + uw_wf_needs_review: + label: 'Needs Review' + weight: -10 + published: false + default_revision: false + uw_wf_unpublished: + label: Unpublished + weight: 0 + published: false + default_revision: true + transitions: + archived: + label: Archive + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: uw_wf_archived + weight: 3 + draft: + label: 'Create draft' + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: draft + weight: 0 + needs_review: + label: 'Submit for review' + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: uw_wf_needs_review + weight: 1 + published: + label: Publish + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: published + weight: 2 + unpublish: + label: Unpublish + from: + - uw_wf_unpublished + to: draft + weight: 4 + entity_types: + bibcite_reference: + - artwork + - audiovisual + - bill + - book + - book_chapter + - broadcast + - case + - chart + - classical + - conference_paper + - conference_proceedings + - database + - film + - government_report + - hearing + - journal + - journal_article + - legal_ruling + - magazine_article + - manuscript + - map + - miscellaneous + - miscellaneous_section + - newspaper_article + - patent + - personal + - presentation + - report + - software + - statute + - thesis + - unpublished + - web_article + - web_project_page + - web_service + - website + node: + - uw_ct_blog + - uw_ct_catalog_item + - uw_ct_contact + - uw_ct_event + - uw_ct_expand_collapse_group + - uw_ct_news_item + - uw_ct_opportunity + - uw_ct_profile + - uw_ct_project + - uw_ct_service + - uw_ct_sidebar + - uw_ct_site_footer + - uw_ct_web_page + default_moderation_state: draft diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml new file mode 100644 index 0000000000000000000000000000000000000000..ed75fe2f0c4c3272b7a18203492a32ccb630f1b1 --- /dev/null +++ b/config/install/cancel_button.settings.yml @@ -0,0 +1,375 @@ +entity_type_cancel_destination: + default: + path: / + enabled: true + comment: + path: / + enabled: false + block: + path: /admin/structure/block + enabled: true + block_content_type: + path: /admin/structure/block/block-content/types + enabled: true + comment_type: + path: /admin/structure/comment + enabled: true + contact_form: + path: /admin/structure/contact + enabled: true + editor: + path: / + enabled: false + field_storage_config: + path: / + enabled: false + field_config: + path: / + enabled: true + file: + path: / + enabled: false + filter_format: + path: /admin/config/content/formats + enabled: true + image_style: + path: /admin/config/media/image-styles + enabled: true + node_type: + path: /admin/structure/types + enabled: true + node: + path: / + enabled: true + shortcut_set: + path: / + enabled: false + shortcut: + path: / + enabled: false + action: + path: / + enabled: false + menu: + path: / + enabled: false + taxonomy_term: + path: / + enabled: true + taxonomy_vocabulary: + path: /admin/structure/taxonomy + enabled: true + tour: + path: / + enabled: false + user_role: + path: /admin/people/roles + enabled: true + user: + path: /admin/people/create + enabled: true + menu_link_content: + path: / + enabled: false + view: + path: / + enabled: false + base_field_override: + path: / + enabled: false + date_format: + path: /admin/config/regional/date-time + enabled: true + entity_view_mode: + path: /admin/structure/display-modes/view + enabled: true + entity_form_display: + path: / + enabled: false + entity_view_display: + path: / + enabled: false + entity_form_mode: + path: /admin/structure/display-modes/form + enabled: true + aggregator_feed: + path: /admin/config/services/aggregator + enabled: true + aggregator_item: + path: / + enabled: false + block_content_uw_cbl_banner_images: + path: / + block_content_uw_cbl_blockquote: + path: / + block_content_uw_cbl_call_to_action: + path: / + block_content_uw_cbl_codepen: + path: / + block_content_uw_cbl_copy_text: + path: / + block_content_uw_cbl_facts_and_figures: + path: / + block_content_uw_cbl_google_maps: + path: / + block_content_uw_cbl_image: + path: / + block_content_uw_cbl_image_gallery: + path: / + block_content_uw_cbl_instagram: + path: / + block_content_uw_cbl_mailchimp: + path: / + block_content_uw_cbl_mailman: + path: / + block_content_uw_cbl_powerbi: + path: / + block_content_uw_cbl_related_links: + path: / + block_content_uw_cbl_remote_video: + path: / + block_content_uw_cbl_services_list: + path: / + block_content_uw_cbl_social_intents: + path: / + block_content_uw_cbl_tableau: + path: / + block_content_uw_cbl_timeline: + path: / + block_content: + enabled: true + captcha_point: + path: /admin/config/people/captcha/captcha-points + enabled: true + contact_message_personal: + path: / + contact_message: + enabled: false + content_moderation_state: + path: / + enabled: false + crop_type: + path: /admin/config/media/crop + enabled: true + crop_uw_crop_media_large: + path: / + crop_uw_crop_media_medium: + path: / + crop_uw_crop_media_small: + path: / + crop_uw_crop_media_x_large: + path: / + crop_uw_crop_media_x_small: + path: / + crop_uw_crop_portrait: + path: / + crop: + enabled: true + dashboard: + path: /admin/structure/dashboards + enabled: true + entity_browser: + path: /admin/config/content/entity_browser + enabled: true + features_bundle: + path: / + enabled: false + field_validation_rule_set: + path: / + enabled: true + fillpdf_form: + path: /admin/structure/fillpdf + enabled: true + fillpdf_file_context: + path: / + enabled: false + fillpdf_form_field: + path: / + enabled: false + imageapi_optimize_pipeline: + path: /admin/config/media/imageapi-optimize-pipelines + enabled: true + language_content_settings: + path: / + enabled: false + configurable_language: + path: /admin/config/regional/language + enabled: true + layout_builder_browser_block: + path: / + enabled: true + layout_builder_browser_blockcat: + path: /admin/config/content/layout-builder-browser/categories + enabled: true + layout_builder_style: + path: /admin/config/content/layout_builder_style + enabled: true + layout_builder_style_group: + path: /admin/config/content/layout_builder_style/group + enabled: true + linkit_profile: + path: /admin/config/content/linkit + enabled: true + media_uw_mt_file: + path: / + media_uw_mt_icon: + path: / + media_uw_mt_image: + path: / + media_uw_mt_local_video: + path: / + media_uw_mt_remote_video: + path: / + media_uw_mt_vimeo_banner_video: + path: / + media: + enabled: true + media_type: + path: /admin/structure/media + enabled: true + metatag_defaults: + path: /admin/config/search/metatag + enabled: true + node_uw_ct_blog: + path: / + node_uw_ct_catalog_item: + path: / + node_uw_ct_contact: + path: / + node_uw_ct_event: + path: / + node_uw_ct_expand_collapse_group: + path: / + node_uw_ct_news_item: + path: / + node_uw_ct_opportunity: + path: / + node_uw_ct_profile: + path: / + node_uw_ct_project: + path: / + node_uw_ct_service: + path: / + node_uw_ct_sidebar: + path: / + node_uw_ct_site_footer: + path: / + node_uw_ct_web_page: + path: / + path_alias: + path: /admin/config/search/path + enabled: true + rdf_mapping: + path: / + enabled: false + redirect: + path: /admin/config/search/redirect + enabled: true + responsive_image_style: + path: /admin/config/media/responsive-image-style + enabled: true + rest_resource_config: + path: / + enabled: false + shortcut_default: + path: / + simple_sitemap: + path: /admin/config/search/simplesitemap + enabled: true + simple_sitemap_type: + path: /admin/config/search/simplesitemap/types + enabled: true + smart_date_format: + path: /admin/config/regional/smart-date + enabled: true + smart_date_rule: + path: / + enabled: false + smart_date_override: + path: / + enabled: false + taxonomy_term_uw_tax_event_tags: + path: / + taxonomy_term_uw_tax_event_type: + path: / + taxonomy_term_uw_vocab_audience: + path: / + taxonomy_term_uw_vocab_blog_tags: + path: / + taxonomy_term_uw_vocab_catalogs: + path: / + taxonomy_term_uw_vocab_catalog_categories: + path: / + taxonomy_term_uw_vocab_contact_group: + path: / + taxonomy_term_uw_vocab_faculties_and_schools: + path: / + taxonomy_term_uw_vocab_news_tags: + path: / + taxonomy_term_uw_vocab_opportunity_employment: + path: / + taxonomy_term_uw_vocab_opportunity_payrate: + path: / + taxonomy_term_uw_vocab_opportunity_type: + path: / + taxonomy_term_uw_vocab_profile_type: + path: / + taxonomy_term_uw_vocab_project_role: + path: / + taxonomy_term_uw_vocab_project_status: + path: / + taxonomy_term_uw_vocab_project_topic: + path: / + taxonomy_term_uw_vocab_service_categories: + path: / + userprotect_rule: + path: /admin/config/people/userprotect/add/user + enabled: true + webform_submission: + path: / + enabled: false + webform_options: + path: /admin/structure/webform/options/manage + enabled: true + webform: + path: / + enabled: true + access_scheme: + path: /admin/config/workflow/workbench_access + enabled: true + section_association: + path: / + enabled: false + workflow: + path: /admin/config/workflow/workflows + enabled: true + pathauto_pattern: + path: /admin/config/search/path/patterns + enabled: true + password_policy: + path: /admin/config/security/password-policy + enabled: true + cookie_category: + path: /admin/config/system/eu-cookie-compliance/categories + enabled: true + paragraphs_type: + path: /admin/structure/paragraphs_type + enabled: true + paragraph_uw_para_call_to_action: + path: / + paragraph_uw_para_fact_figure: + path: / + paragraph_uw_para_ff: + path: / + paragraph_uw_para_image_banner: + path: / + paragraph_uw_para_local_video_banner: + path: / + paragraph_uw_para_project_members: + path: / + paragraph_uw_para_timeline: + path: / + paragraph_uw_para_vimeo_video_banner: + path: / + paragraph: + enabled: true diff --git a/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml b/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..07bbcab5544825f0e929c09d997b535745ae3800 --- /dev/null +++ b/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml @@ -0,0 +1,51 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_image_banner.field_uw_ban_image + - field.field.paragraph.uw_para_image_banner.field_uw_ban_link + - field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link + - media_library +id: paragraph.uw_para_image_banner.default +targetEntityType: paragraph +bundle: uw_para_image_banner +mode: default +content: + field_uw_ban_big_text: + weight: 2 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_uw_ban_image: + type: media_library_widget + weight: 0 + settings: + media_types: { } + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 1 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_uw_ban_small_text: + weight: 3 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content +hidden: + created: true + status: true diff --git a/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml b/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..45af8a210f996c9455e36bc60205153ef995578f --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml @@ -0,0 +1,54 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_image_banner.field_uw_ban_image + - field.field.paragraph.uw_para_image_banner.field_uw_ban_link + - field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link +id: paragraph.uw_para_image_banner.default +targetEntityType: paragraph +bundle: uw_para_image_banner +mode: default +content: + field_uw_ban_big_text: + weight: 2 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_image: + type: entity_reference_entity_view + weight: 0 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 1 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_uw_ban_small_text: + weight: 3 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content +hidden: { } diff --git a/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml b/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..7977e9e9367c0c83f56df6ea28c2516db7b18e7f --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml @@ -0,0 +1,64 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - link +id: paragraph.uw_para_local_video_banner.default +targetEntityType: paragraph +bundle: uw_para_local_video_banner +mode: default +content: + field_uw_ban_big_text: + weight: 3 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_fallback_image: + type: entity_reference_entity_view + weight: 1 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 2 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_uw_ban_small_text: + weight: 4 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_video: + type: entity_reference_entity_view + weight: 0 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content +hidden: { } diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..6af8db66f0ae5c0af343b69a043265844d283fa3 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_image_banner +label: 'Big text' +description: 'Big text appears at a larger size, and, if both are set, above the small text.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..95b29cecc911ea156c51fc71a0a89646566d2a38 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml @@ -0,0 +1,32 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_image +field_name: field_uw_ban_image +entity_type: paragraph +bundle: uw_para_image_banner +label: Image +description: 'A minimum banner size of 1010x300 is recommended. Banners that are narrower or wider than their location will be automatically scaled to fit.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml new file mode 100644 index 0000000000000000000000000000000000000000..e4a1d1ff06608c4b7e81d20b69550160b5d4a3d6 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_image_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..ea2b96a41d14a3fc10c3164c13a92b0b4890ea30 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_image_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..f19518a971a07fd49bd06a1bd199081e1ea76505 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Big text' +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..98e1b2b9e1da1abb096e85549ef50a9efb6d1ee2 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_fallback_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Fallback image' +description: 'This image will be used as a fallback in case the video doesn''t load.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml new file mode 100644 index 0000000000000000000000000000000000000000..598ba617622abda5456d2019ae9cbf2348c06e07 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_local_video_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..f4eebfbd33bd4b035ae79c4759212c786ce78514 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml new file mode 100644 index 0000000000000000000000000000000000000000..b351fe5a3468fb6bd271d7840ca795b91b71c928 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_video + - media.type.uw_mt_local_video + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_video +field_name: field_uw_ban_video +entity_type: paragraph +bundle: uw_para_local_video_banner +label: Video +description: 'For best results, the video should be 1080 pixels wide. Video banners that are narrower or wider than their location will be automatically scaled to fit.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_local_video: uw_mt_local_video + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..e6c14ba1779b0eae822d5b67931e79f10848fc9c --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Big text' +description: 'Big text appears at a larger size, and, if both are set, above the small text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..1289f73975d7cac4a9337ea17e8b2e403c3aba83 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_fallback_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Fallback image' +description: 'This image will be used as a fallback in case the video doesn''t load.' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml new file mode 100644 index 0000000000000000000000000000000000000000..d3cbed25f16f86c5d1653024032753977b559098 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..399dfeff04632f349103b22c2aa773eaedf2c604 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml new file mode 100644 index 0000000000000000000000000000000000000000..e33d5c4ebc6b3bc0b9e27bdf6b0ad0e6d623ebfb --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_vimeo_video + - media.type.uw_mt_vimeo_banner_video + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video +field_name: field_uw_ban_vimeo_video +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Vimeo video' +description: 'This MUST be from a paid Vimeo account. Videos from free accounts will display Vimeo''s player and branding.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_vimeo_banner_video: uw_mt_vimeo_banner_video + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.storage.node.field_uw_audience.yml b/config/install/field.storage.node.field_uw_audience.yml new file mode 100644 index 0000000000000000000000000000000000000000..2801f27d7a8bdb4b618dd00a9d68915aa3801c52 --- /dev/null +++ b/config/install/field.storage.node.field_uw_audience.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_uw_audience +field_name: field_uw_audience +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_autoplay.yml b/config/install/field.storage.node.field_uw_autoplay.yml new file mode 100644 index 0000000000000000000000000000000000000000..15dd121d29d8b237ebc808df7a3f94954e96d10b --- /dev/null +++ b/config/install/field.storage.node.field_uw_autoplay.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_autoplay +field_name: field_uw_autoplay +entity_type: node +type: boolean +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_banner.yml b/config/install/field.storage.node.field_uw_banner.yml new file mode 100644 index 0000000000000000000000000000000000000000..097743bac10d4fb9632bf2b1cd507e2e518b907f --- /dev/null +++ b/config/install/field.storage.node.field_uw_banner.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_uw_banner +field_name: field_uw_banner +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: 8 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_hero_image.yml b/config/install/field.storage.node.field_uw_hero_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..e075939ae51a30f510b771fb2ab52bd52ec4b6a4 --- /dev/null +++ b/config/install/field.storage.node.field_uw_hero_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_uw_hero_image +field_name: field_uw_hero_image +entity_type: node +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_media_width.yml b/config/install/field.storage.node.field_uw_media_width.yml new file mode 100644 index 0000000000000000000000000000000000000000..ad32cfdedec64f9c9b412a7e57a719f39cac3402 --- /dev/null +++ b/config/install/field.storage.node.field_uw_media_width.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_uw_media_width +field_name: field_uw_media_width +entity_type: node +type: list_string +settings: + allowed_values: { } + allowed_values_function: _uw_cfg_common_get_layout_builder_styles +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_slide_speed.yml b/config/install/field.storage.node.field_uw_slide_speed.yml new file mode 100644 index 0000000000000000000000000000000000000000..ecc45be713f211d0c864381cc89f78155b1a3bd4 --- /dev/null +++ b/config/install/field.storage.node.field_uw_slide_speed.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_slide_speed +field_name: field_uw_slide_speed +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_text_overlay_style.yml b/config/install/field.storage.node.field_uw_text_overlay_style.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f455497bc067d0decebae1c942e6a9e9873c150 --- /dev/null +++ b/config/install/field.storage.node.field_uw_text_overlay_style.yml @@ -0,0 +1,32 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_uw_text_overlay_style +field_name: field_uw_text_overlay_style +entity_type: node +type: list_string +settings: + allowed_values: + - + value: full-width + label: 'Full banner width, bottom, theme colour background ("FDSU" style)' + - + value: inset + label: 'Inset from banner, bottom, black background ("home page" style)' + - + value: split + label: 'Split top and bottom, black and white backgrounds ("single page" style)' + - + value: full-overlay + label: 'Full black overlay, centered text ("conference" style)' + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_transition_speed.yml b/config/install/field.storage.node.field_uw_transition_speed.yml new file mode 100644 index 0000000000000000000000000000000000000000..d14af6219989269cb129fe9df43b34d9e177df59 --- /dev/null +++ b/config/install/field.storage.node.field_uw_transition_speed.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_transition_speed +field_name: field_uw_transition_speed +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_type_of_media.yml b/config/install/field.storage.node.field_uw_type_of_media.yml index 3671c93b57d9cf62e460a8afdd274ce3a490cc75..bec04cb72328e79ae1ba41e423547e6ed00311dc 100644 --- a/config/install/field.storage.node.field_uw_type_of_media.yml +++ b/config/install/field.storage.node.field_uw_type_of_media.yml @@ -9,11 +9,8 @@ field_name: field_uw_type_of_media entity_type: node type: list_string settings: - allowed_values: - - - value: image - label: Image - allowed_values_function: '' + allowed_values: { } + allowed_values_function: _uw_cfg_common_allowed_media_types module: options locked: false cardinality: 1 diff --git a/config/install/field.storage.paragraph.field_uw_ban_big_text.yml b/config/install/field.storage.paragraph.field_uw_ban_big_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..82334c0cfeaf1e3608c50c9aed52bcad35c2861f --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_big_text.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +type: string +settings: + max_length: 128 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml b/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..ca6321c059f6852120d9ab38e1cc427985266810 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_image.yml b/config/install/field.storage.paragraph.field_uw_ban_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..fa4f848644fdf5c21a6b6ed5a4fdd2a339dc3b20 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_image +field_name: field_uw_ban_image +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_link.yml b/config/install/field.storage.paragraph.field_uw_ban_link.yml new file mode 100644 index 0000000000000000000000000000000000000000..99b66462455c2a777d7a1c2c4418b1108a094eb7 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_link.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - link + - paragraphs +id: paragraph.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_small_text.yml b/config/install/field.storage.paragraph.field_uw_ban_small_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..30de97bac97e977cf65ee33741357d25ae418b19 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_small_text.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_video.yml b/config/install/field.storage.paragraph.field_uw_ban_video.yml new file mode 100644 index 0000000000000000000000000000000000000000..e839cbb5b3f87122eaa7bf22b6c6eaf48ad138f1 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_video.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_video +field_name: field_uw_ban_video +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml b/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml new file mode 100644 index 0000000000000000000000000000000000000000..df04da2f5d3a3fbfec66625616b5824e50c3795f --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_vimeo_video +field_name: field_uw_ban_vimeo_video +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml new file mode 100644 index 0000000000000000000000000000000000000000..0d53a14319886aa4027669dc4664322d85e734bd --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_list_automatic +block_id: uw_cbl_contacts_automatic +category: uw_bc_listings +label: 'Contact list (automatic)' +image_path: images/layout_builder_browser/contactlist.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Contact list automatic' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml new file mode 100644 index 0000000000000000000000000000000000000000..12ebf06fe2e56ef1c6786b1f26c7b706276a3eb7 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_list_manual +block_id: uw_cbl_contacts_manual +category: uw_bc_listings +label: 'Contact list (manual)' +image_path: images/layout_builder_browser/contactlist-manual.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Contact list manual' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..2dccb7e0a419e45dc6af4edd8e744410c40a6d6d --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_teaser +block_id: uw_cbl_contact_teaser +category: uw_bc_teasers +label: 'Contact teaser' +image_path: images/layout_builder_browser/contactteaser.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: Contact +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml new file mode 100644 index 0000000000000000000000000000000000000000..4bb8ae98884975c66d502b9d742105634e8d9444 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_list +block_id: 'views_block:bibcite_reference-bibcite_reference_block' +category: uw_bc_listings +label: 'Publication reference list' +image_path: images/layout_builder_browser/referencelist.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Publication reference list' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml new file mode 100644 index 0000000000000000000000000000000000000000..259109984b8219759d75313fb680064f7fb7cba1 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_search +block_id: bibcite_cbl_reference_search +category: uw_bc_searches +label: 'Publication reference search' +image_path: images/layout_builder_browser/referencesearch.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Publication reference search' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..e1d24bb36411f171de3730e3f953e4621e49a1e4 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_teaser +block_id: bibcite_cbl_reference_teaser +category: uw_bc_teasers +label: 'Publication reference teaser' +image_path: images/layout_builder_browser/referenceteaser.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Publication reference teaser' +weight: 0 diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml index 3576c282101a33ec3cf7cf3e07e0a679e0c840ae..5d9396e6953cb75c48faec813e75b1de17ab6672 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml @@ -5,7 +5,7 @@ id: uw_lbs_carousel_4_items label: 'Carousel - 4 items' classes: uw-carousel--four-items type: component -group: default +group: default weight: -7 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml index d68c387a7e9a07b92e07db5cc9b03faf2f7dc59c..621cb4f56fb94ae3b12221d03fbb48acf7de54b8 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml @@ -10,7 +10,6 @@ weight: -4 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' - - 'inline_block:uw_cbl_facebook' - 'inline_block:uw_cbl_facts_and_figures' - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' diff --git a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml index 461e8dd108adf4514b9d0151ca25263fb0204d10..f3124d84b7b6515c77aa03f6aa545c44b8b704ff 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml @@ -10,7 +10,6 @@ weight: -3 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' - - 'inline_block:uw_cbl_facebook' - 'inline_block:uw_cbl_facts_and_figures' - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' diff --git a/config/install/metatag.settings.yml b/config/install/metatag.settings.yml index f13c69eb1021771dfc51125afc388fbeff9c1530..1fe2185962f855c55d3d7c13ffc997b76a33e46b 100644 --- a/config/install/metatag.settings.yml +++ b/config/install/metatag.settings.yml @@ -53,11 +53,24 @@ entity_type_groups: advanced: advanced open_graph: open_graph twitter_cards: twitter_cards - schema_web_page: schema_web_page schema_service: schema_service + schema_web_page: schema_web_page uw_ct_web_page: basic: basic advanced: advanced open_graph: open_graph twitter_cards: twitter_cards schema_web_page: schema_web_page +tag_trim_method: beforeValue +tag_trim_maxlength: + metatag_maxlength_description: null + metatag_maxlength_abstract: null + metatag_maxlength_title: null + metatag_maxlength_og_description: null + metatag_maxlength_og_site_name: null + metatag_maxlength_og_title: null + metatag_maxlength_twitter_cards_title: null + metatag_maxlength_twitter_cards_label1: null + metatag_maxlength_twitter_cards_description: null + metatag_maxlength_twitter_cards_label2: null +tag_scroll_max_height: '' diff --git a/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml new file mode 100644 index 0000000000000000000000000000000000000000..8cc48caa0b0012ec64d19ad800176aac8dd0be70 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_image_banner +label: 'Image banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml new file mode 100644 index 0000000000000000000000000000000000000000..b10b838546ca8941f781b08e8d2970f505c21a33 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_local_video_banner +label: 'Local video banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml new file mode 100644 index 0000000000000000000000000000000000000000..32e31675e9cd0c8b2fe17875a99a53767fb8f418 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_vimeo_video_banner +label: 'Vimeo video banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/config/install/pathauto.settings.yml b/config/install/pathauto.settings.yml index 6d7bc2264c6102b0e1314c5611e40eeef2a18b3c..b521d662f58a44b291b0db57ae610d7271a1b67c 100644 --- a/config/install/pathauto.settings.yml +++ b/config/install/pathauto.settings.yml @@ -1,4 +1,7 @@ enabled_entity_types: + - bibcite_contributor + - bibcite_keyword + - bibcite_reference - block_content - user punctuation: diff --git a/src/Controller/UwDownloadCsvController.php b/src/Controller/UwDownloadCsvController.php index b5cba5e39556d110c1a790ac8124380fbebab15f..714801afc6521d2f77e05425c95f7d9419ae5fcf 100644 --- a/src/Controller/UwDownloadCsvController.php +++ b/src/Controller/UwDownloadCsvController.php @@ -138,8 +138,8 @@ class UwDownloadCsvController extends ControllerBase { 'type' => $node->type->entity->label(), 'path' => $this->pathAlias->getAliasByPath('/node/' . $node->id()), 'published' => $node->status->value == 1 ? 'yes' : 'no', - 'created' => date('Y-d-m G:i', $node->getCreatedTime()), - 'updated' => date('Y-d-m G:i', $node->getChangedTime()), + 'created' => date('Y-m-d G:i', $node->getCreatedTime()), + 'updated' => date('Y-m-d G:i', $node->getChangedTime()), ]; // Store the node info for use later in the CSV. diff --git a/src/EventSubscriber/UwDeleteFormEventSubscriber.php b/src/EventSubscriber/UwDeleteFormEventSubscriber.php index 286c1198798b927d33bccddcf0d107a81e67157e..4d5fa9b144e748eae9b765d7c6eecddcf96daddd 100644 --- a/src/EventSubscriber/UwDeleteFormEventSubscriber.php +++ b/src/EventSubscriber/UwDeleteFormEventSubscriber.php @@ -50,80 +50,18 @@ class UwDeleteFormEventSubscriber implements EventSubscriberInterface { public function alterForm(FormAlterEvent $event): void { $form = &$event->getForm(); - // Define all names in an array. - $names = [ - 'ct_names' => [ - 'uw_ct_blog', - 'uw_ct_contact', - 'uw_ct_catalog_item', - 'uw_ct_event', - 'uw_ct_expand_collapse_group', - 'uw_ct_news_item', - 'uw_ct_opportunity', - 'uw_ct_profile', - 'uw_ct_project', - 'uw_ct_service', - 'uw_ct_sidebar', - 'uw_ct_site_footer', - 'uw_ct_web_page', - ], - 'vocab_names' => [ - 'uw_vocab_blog_tags', - 'uw_vocab_contact_group', - 'uw_vocab_audience', - 'uw_vocab_catalog_categories', - 'uw_vocab_catalogs', - 'uw_tax_event_tags', - 'uw_tax_event_type', - 'uw_vocab_news_tags', - 'uw_vocab_profile_type', - 'uw_vocab_project_roles', - 'uw_vocab_project_topics', - 'uw_vocab_service_categories', - ], - 'media_names' => [ - 'uw_mt_file', - 'uw_mt_icon', - 'uw_mt_image', - 'uw_mt_local_video', - 'uw_mt_remote_video', - 'uw_mt_vimeo_banner_video', - ], - ]; - - // Loop all names in array. - foreach ($names as $key => $type_names) { - foreach ($type_names as $name) { - $custom_waring_message = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.'); - - // Use custom warning message for deleting nodes, terms and medias. - // The user has 'delete any' and 'delete own' permissions. - if ($key == 'ct_names') { - if (($form['#form_id'] == 'node_' . $name . '_delete_form') && - ($this->currentUser->hasPermission('delete any ' . $name . ' content') || - $this->currentUser->hasPermission('delete own ' . $name . ' content'))) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - // The user has 'delete terms' permission. - if ($key == 'vocab_names') { - if (($form['#form_id'] == 'taxonomy_term_' . $name . '_delete_form') && - $this->currentUser->hasPermission('delete terms in ' . $name)) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - // The user has 'delete any' permission. - if ($key == 'media_names') { - if (($form['#form_id'] == 'media_' . $name . '_delete_form') && - ($this->currentUser->hasPermission('delete any media') || $this->currentUser->hasPermission('delete any ' . $name . ' media') || - $this->currentUser->hasPermission('delete own ' . $name . ' media'))) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - } + // Change the deletion warning on any of the following forms. + // - any node, taxonomy term, or media deletion page. + // - the node delete multiple page. + // - the media delete multiple page. + if ( + preg_match('/^(?:node|taxonomy_term|media)_.+_delete_form$/', $form['#form_id']) + || + $form['#form_id'] == 'node_delete_multiple_confirm_form' + || + $form['#form_id'] == 'media_delete_multiple_confirm_form' + ) { + $form['description']['#markup'] = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.'); } } diff --git a/src/EventSubscriber/UwWebformEventSubscriber.php b/src/EventSubscriber/UwWebformEventSubscriber.php new file mode 100644 index 0000000000000000000000000000000000000000..d2486723e6fbaea45fbcb54ad1b73e6e68d77d8f --- /dev/null +++ b/src/EventSubscriber/UwWebformEventSubscriber.php @@ -0,0 +1,53 @@ + 'preSave', + ]; + } + + /** + * Entity pre save dispatched event. + * + * @param \Drupal\core_event_dispatcher\Event\Entity\EntityPresaveEvent $event + * Event object. + */ + public function preSave(EntityPresaveEvent $event): void { + $entity = $event->getEntity(); + + if ($entity->bundle() === 'webform') { + /** @var \Drupal\webform\Entity\Webform $entity */ + $access_rules = $entity->getAccessRules(); + + // Update webform submission access roles to be anonymous and + // authenticated. This will be done on EVERY webform save. + // Fixes migration issue with webforms. Once migration is updated and + // fixed, this code is no longer needed and can be removed. + $access_rules['create']['roles'] = [ + 'anonymous', + 'authenticated', + ]; + + $entity->setAccessRules($access_rules); + + // Setting default access denied handler. + $entity->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_PAGE); + } + } + +} diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php new file mode 100644 index 0000000000000000000000000000000000000000..ecb363ae09a0dfdcd8fba2d1e9506c962c695b18 --- /dev/null +++ b/src/Form/UwAddUsersForm.php @@ -0,0 +1,191 @@ +get('path_alias.manager'), + $container->get('uw_cfg_common.uw_ldap'), + $container->get('entity_type.manager') + ); + } + + /** + * Class constructor. + */ + public function __construct(AliasManager $pathAliasManager, UWLdap $uwLdap, EntityTypeManagerInterface $entityTypeManager) { + $this->pathAliasManager = $pathAliasManager; + $this->uwLdap = $uwLdap; + $this->entityTypeManager = $entityTypeManager; + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'uw_add_users_form'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + // The list of users from this form. + $form['users'] = [ + '#title' => $this->t('WatIAM user ID(s): (maximum 8 characters per ID)'), + '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.
You can use authenticated campus people directory if you don\'t know their user ID (will open a new window).'), + '#type' => 'textarea', + '#required' => TRUE, + ]; + + // The submit button. + $form['actions']['#type'] = 'actions'; + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Create new account(s)'), + '#button_type' => 'primary', + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + + // The user ID list that was submitted in the form. + $submitted_users = explode(PHP_EOL, $form_state->getValue('users')); + + // Be nice and remove whitespace. + $submitted_users = array_map('trim', $submitted_users); + // Remove empty lines. + $submitted_users = array_filter($submitted_users); + // Apply to lower case on all lines. + $submitted_users = array_map('strtolower', $submitted_users); + // Remove any duplicates. + $submitted_users = array_unique($submitted_users); + + // Step through each of the submitted users to create if needed/possible, + // or show a message if not. + foreach ($submitted_users as $user) { + // Don't process long user IDs. + if (strlen($user) > 8) { + $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', ['@user' => $user])); + continue; + } + + // Don't process user IDs with invalid characters. + if (!preg_match('/^[a-z0-9]+$/', $user)) { + $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', ['@user' => $user])); + continue; + } + + $existing_user = $this->entityTypeManager->getStorage('user')->loadByProperties([ + 'name' => $user, + ]); + + /** @var \Drupal\user\UserInterface|bool $existing_user */ + $existing_user = $existing_user ? reset($existing_user) : FALSE; + + if ($existing_user) { + $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', + [ + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->id()), + '@user' => $user, + ] + )); + continue; + } + + // Seems OK - move on. + // Create a strong random password. + $sets[] = 'abcdefghijklmnopqrstuvwxyz'; + $sets[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $sets[] = '0123456789'; + $sets[] = '!@#$%^&*()-_=+[]{}?`~"'; + $password = ''; + $password_length = random_int(16, 32); + while (strlen($password) < $password_length) { + foreach ($sets as $set) { + $password .= $set[array_rand(str_split($set))]; + if (strlen($password) === $password_length) { + break; + } + } + } + $password = str_shuffle($password); + + // Do the LDAP lookup. + $person = $this->uwLdap->lookupPerson($user); + if (!$person) { + $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', ['@user' => $user])); + continue; + } + $firstname = empty($person['givenname'][0]) ? 'Firstname' : $person['givenname'][0]; + $lastname = empty($person['sn'][0]) ? 'Lastname' : $person['sn'][0]; + $email = empty($person['mail'][0]) ? $user . '@uwaterloo.ca' : $person['mail'][0]; + + // Add the user. + $new_user = User::create(); + $new_user->setPassword($password); + $new_user->enforceIsNew(); + $new_user->setEmail($email); + $new_user->setUsername($user); + $new_user->set('field_uw_first_name', $firstname); + $new_user->set('field_uw_last_name', $lastname); + $new_user->activate(); + $new_user->save(); + + $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', + [ + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $new_user->id()), + '@user' => $user, + ] + )); + } + + // Set the message that the users have been created. + $this->messenger()->addStatus($this->t('Finished creating users.')); + } + +} diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 7e6a4bb38fce10e58eba634b281f9eb403a22ef5..365aad3a5174969e2c0a370883ce4f4f89b90683 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -210,6 +210,7 @@ class UWService implements UWServiceInterface { 'uw_ct_project', 'uw_ct_catalog_item', 'uw_ct_service', + 'uw_ct_web_page', ]; break; @@ -230,8 +231,15 @@ class UWService implements UWServiceInterface { case 'media': $preprocess = [ 'uw_ct_blog', + 'uw_ct_catalog_item', + 'uw_ct_contact', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_opportunity', + 'uw_ct_profile', + 'uw_ct_project', + 'uw_ct_service', + 'uw_ct_web_page', ]; break; } @@ -239,6 +247,52 @@ class UWService implements UWServiceInterface { return $preprocess; } + /** + * {@inheritDoc} + */ + public function uwGetMediaFlags(Node $node, string $view_mode = NULL): array { + + // Set the defaults for the flags to false. + $media_flags['has_media'] = FALSE; + $media_flags['show_header_in_media'] = FALSE; + $media_flags['has_portrait'] = FALSE; + + // If we are not on a teaser, then set the media flags. + if ($view_mode !== 'teaser') { + + // If there is a type of media field, continue to look + // for media flags. + if ($node->hasField('field_uw_type_of_media')) { + + // If there is a type of media set, then set has_media, + // and look for media in header. + if ($type_of_media = $node->field_uw_type_of_media->value) { + + // Set has_media flag. + $media_flags['has_media'] = TRUE; + + // If the type of media is image, the header needs to + // go inside the media, so set the flag. + if ($type_of_media == 'image') { + $media_flags['show_header_in_media'] = TRUE; + } + } + + // Special case is contact, we need to look if there + // is a portrait image and if so set the has_media. + if ($node->getType() == 'uw_ct_contact') { + + // If there is a portrait image, set the has_media. + if ($node->field_uw_ct_contact_image->getValue()) { + $media_flags['has_portrait'] = TRUE; + } + } + } + } + + return $media_flags; + } + /** * {@inheritDoc} */ diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php index b8eaee2752cf3342a0740c06586e7c97ddd63106..6c5049020a90ee1c258d36af8f775f14c784ff89 100644 --- a/src/Service/UWServiceInterface.php +++ b/src/Service/UWServiceInterface.php @@ -59,6 +59,19 @@ interface UWServiceInterface { */ public function uwGetNodePreprocessing(string $type): array; + /** + * Gets the flags for showing media on nodes. + * + * @param \Drupal\node\Node $node + * Node entity. + * @param string $view_mode + * The view mode of the node. + * + * @return array + * Array of flags for media. + */ + public function uwGetMediaFlags(Node $node, string $view_mode = NULL): array; + /** * Gets dates from node. * diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 383d485e42f7b4e1874fee9a615e67e2a7c1deed..32ec45654bbb2adefdf65526bb886b4e5197dcb8 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -401,13 +401,7 @@ class UwNodeContent { // Setup the header content. if ($node_flags['get_header']) { - if ($view_mode == 'teaser') { - $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); - } - else { - $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); - $content_data['header']['author'] = $this->addToContentData('author', 'field_author'); - } + $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); } // Get the media. @@ -488,6 +482,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_news_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for catalog items. if ($node_flags['get_footer']) { @@ -574,6 +572,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', NULL); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer data. if ($node_flags['get_footer']) { @@ -637,6 +639,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_profile_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for the profile. if ($node_flags['get_footer']) { $content_data['footer']['links']['has_children'] = TRUE; @@ -677,6 +683,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_project_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get listing image. if ($node_flags['get_image']) { $content_data['image'] = $this->addToContentData('image', 'field_uw_project_listing_image'); @@ -731,6 +741,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_service_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for the profile. if ($node_flags['get_footer']) { $content_data['footer']['service_information']['has_children'] = TRUE; @@ -823,6 +837,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_opportunity_position'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + return $content_data; } diff --git a/src/Service/UwNodeData.php b/src/Service/UwNodeData.php index 2eaa511793ee75cbc685d4e6190f85af2c6f3571..c9b61e9cfb3582106cbdf80452f3dfca9d862947 100644 --- a/src/Service/UwNodeData.php +++ b/src/Service/UwNodeData.php @@ -180,7 +180,7 @@ class UwNodeData { // If the element is empty, unset it. if ($data == NULL && empty($data)) { - unset($node_data[$index]); + unset($node_data[$index][$sub_index]); } } } diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index 0a9e12e091c1587d3575e48bc1998fbfa8e1d6f4..f0519a9b24908b841b8f837b07c8468073a389a9 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -250,6 +250,18 @@ class UwNodeFieldValue { // Set the banners as empty in case we do not have any. $banners = []; + // Ensure that there is a media with and if so get + // the classes for the width. + if ($node->hasField('field_uw_media_width')) { + + // Get the layout builder style based from the node value + // of media width. + $layout_builder_style = $layout_style = \Drupal::entityTypeManager()->getStorage('layout_builder_style')->load($node->field_uw_media_width->value); + + // Get the classes associated with the layout builder style. + $media_width_classes = $layout_builder_style->getClasses(); + } + // Process banner images. foreach ($node->$field_name as $banner_item) { @@ -300,10 +312,13 @@ class UwNodeFieldValue { $banners = [ 'images' => $images, - // 'autoplay' => $block_content->field_uw_autoplay->value, - // 'slide_speed' => $block_content->field_uw_slide_speed->value, - // 'style' => $block_content->field_uw_text_overlay_style->value, - // 'transition_speed' => $block_content->field_uw_transition_speed->value, + 'autoplay' => $node->field_uw_autoplay->value, + 'slide_speed' => $node->field_uw_slide_speed->value, + 'style' => $node->field_uw_text_overlay_style->value, + 'transition_speed' => $node->field_uw_transition_speed->value, + 'media_width' => $media_width_classes ?? NULL, + 'bundle' => $node->getType(), + 'uuid' => uniqid(), ]; return $banners; diff --git a/src/UwPermissions/UwPermissions.php b/src/UwPermissions/UwPermissions.php index 7681d80261317cf817a74d8e687d01e0d2d59c46..69e5344c55cb82a15801bb3807f0f48bb3106ef2 100644 --- a/src/UwPermissions/UwPermissions.php +++ b/src/UwPermissions/UwPermissions.php @@ -244,6 +244,78 @@ class UwPermissions { ), ], + // References permissions. + 'References' => [ + 'Create new Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_contributor' + ), + 'Create new Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_keyword' + ), + 'Create new Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_reference' + ), + 'Edit contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'edit bibcite_contributor' + ), + 'Edit Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'edit bibcite_keyword' + ), + 'Edit any Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'edit any bibcite_reference' + ), + 'Revert all Reference revisions' => + UwPermissions::buildRolePermissionsListCustom( + 'revert all bibcite_reference revisions' + ), + 'Administer Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_contributor' + ), + 'Administer Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_keyword' + ), + 'Administer Reference entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_reference' + ), + 'Delete Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'delete bibcite_contributor' + ), + 'Delete Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'delete bibcite_keyword' + ), + 'Delete all Reference revisions' => + UwPermissions::buildRolePermissionsListCustom( + 'delete all bibcite_reference revisions' + ), + 'Delete any Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'delete any bibcite_reference' + ), + 'Access Reference Export' => + UwPermissions::buildRolePermissionsListCustom( + 'access bibcite export' + ), + 'Access to import form' => + UwPermissions::buildRolePermissionsListCustom( + 'bibcite import' + ), + 'Access to populate form' => + UwPermissions::buildRolePermissionsListCustom( + 'bibcite populate' + ), + ], + // Service permissions. 'Service' => [ 'Use content type' => @@ -293,6 +365,7 @@ class UwPermissions { 'uw_ct_web_page' ), ], + ]; return $uw_permissions; diff --git a/src/UwRoles/user.role.uw_role_content_editor.yml b/src/UwRoles/user.role.uw_role_content_editor.yml index a75dbd87d04f6adda4c43356c13a584de3e4b33f..7878eddc7b378a3b5d7b67a97f2a9efb72a2c667 100644 --- a/src/UwRoles/user.role.uw_role_content_editor.yml +++ b/src/UwRoles/user.role.uw_role_content_editor.yml @@ -87,6 +87,19 @@ permissions: - 'create paragraph content uw_para_timeline' - 'create paragraph content uw_para_vimeo_video_banner' - 'create url aliases' + - 'delete paragraph content uw_para_call_to_action' + - 'delete paragraph content uw_para_call_to_action_text' + - 'delete paragraph content uw_para_ec_item' + - 'delete paragraph content uw_para_fact_figure' + - 'delete paragraph content uw_para_fact_point' + - 'delete paragraph content uw_para_fact_text' + - 'delete paragraph content uw_para_facts_and_figures' + - 'delete paragraph content uw_para_ff' + - 'delete paragraph content uw_para_image_banner' + - 'delete paragraph content uw_para_local_video_banner' + - 'delete paragraph content uw_para_project_members' + - 'delete paragraph content uw_para_timeline' + - 'delete paragraph content uw_para_vimeo_video_banner' - 'enter uw_ct_blog revision log entry' - 'enter uw_ct_catalog_item revision log entry' - 'enter uw_ct_contact revision log entry' diff --git a/uw_cfg_common.info.yml b/uw_cfg_common.info.yml index 434c8061097753cdc6db3bd99969508ec54005fb..75235a63c0df1f96c54f8290d2312d6f641f9c75 100644 --- a/uw_cfg_common.info.yml +++ b/uw_cfg_common.info.yml @@ -5,6 +5,7 @@ type: module core_version_requirement: '^8.9 || ^9' dependencies: - 'allowed_formats:allowed_formats' + - 'cancel_button:cancel_button' - 'composer_deploy:composer_deploy' - 'drupal:anchor_link' - 'drupal:better_exposed_filters' @@ -29,10 +30,12 @@ dependencies: - 'drupal:layout_builder_modal' - 'drupal:layout_builder_restrictions' - 'drupal:layout_builder_styles' + - 'drupal:link' - 'drupal:linkit' - 'drupal:mailsystem' - 'drupal:media' - 'drupal:media_embed_extra' + - 'drupal:media_library' - 'drupal:metatag' - 'drupal:node' - 'drupal:options' @@ -50,11 +53,14 @@ dependencies: - 'drupal:user' - 'drupal:userprotect' - 'drupal:views' + - 'entity_reference_revisions:entity_reference_revisions' - 'fillpdf:fillpdf' - 'layout_builder_ids:layout_builder_ids' - 'maxlength:maxlength' - 'metatag:metatag_extended_perms' + - 'paragraphs:paragraphs' - 'quick_node_clone:quick_node_clone' + - 'require_on_publish:require_on_publish' - 'scheduler:scheduler' - 'simple_sitemap:simple_sitemap' - 'subpathauto:subpathauto' diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 7ce88d6d19654769da8750093169901738297d0b..c5c52ba5b5d140c8f0eba37bc50e8d4917f44e37 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -6,6 +6,7 @@ */ use Drupal\Core\Config\FileStorage; +use Drupal\field\Entity\FieldConfig; use Drupal\node\Entity\Node; use Drupal\taxonomy\Entity\Term; use Drupal\user\Entity\Role; @@ -19,6 +20,16 @@ use Symfony\Component\Yaml\Yaml; */ function uw_cfg_common_install() { + // ISTWCMS-5865: this the attempt to fix features for our build. + // Moving the actual installing of workflows to here, so that + // we can include workflows as a dependency in our modules and + // that it will allow new site installs. + $name = 'workflows.workflow.uw_workflow'; + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/'; + $source = new FileStorage($path); + $active_storage = \Drupal::service('config.storage'); + $active_storage->write($name, $source->read($name)); + // Get the role ids for UW roles. $uw_rids = UwRoles::getUwRoleIds(); @@ -437,3 +448,263 @@ function uw_cfg_common_update_9104(&$sandbox) { $service->removeMissingBlocksFromUnsaved(); $service->removeMissingBlocksFromSaved(); } + +/** + * Feature revert for workflows. + */ +function uw_cfg_common_update_9105(&$sandbox) { + $name = 'workflows.workflow.uw_workflow'; + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/'; + $source = new FileStorage($path); + $active_storage = \Drupal::service('config.storage'); + $active_storage->write($name, $source->read($name)); +} + +/** + * Add new fields for banners above. + */ +function uw_cfg_common_update_9106(&$sandbox) { + + // The database service. + $database = \Drupal::database(); + + // The tables to be used for fields to get and remove. + $tables = [ + 'node__field_uw_type_of_media', + 'node_revision__field_uw_type_of_media', + 'node__field_uw_hero_image', + 'node_revision__field_uw_hero_image', + ]; + + // Setting up an empty array so that we do not get + // undefined index or unknown variable error. + $node_data = []; + + // Step through each of the tables and get the data, + // then truncate them. We need to truncate the table + // so that we are able to modify the fields, if there + // is data in these tables, Drupal throws an error about + // data already existing in the fields. We will insert + // the data back into the tables after everything is + // completed. + foreach ($tables as $table) { + + // Get the rows in the table. + $values = $database->select($table, 'n') + ->fields('n') + ->execute() + ->fetchAll(); + + // Step through each of the rows and add to variable. + foreach ($values as $value) { + + // Add to the variable and cast to an array so that + // we are not using an object, just makes it easier + // to work with when inserting these rows back + // into the database. + $node_data[$table][] = (array) $value; + } + + // Truncate the table. + $database->truncate($table)->execute(); + } + + // The content types that are not getting any changes. + $cts_not_to_install = [ + 'uw_ct_sidebar', + 'uw_ct_site_footer', + 'uw_ct_expand_collapse_group', + ]; + + // The content types with media already in it (hero image). + $cts_with_media = [ + 'uw_ct_blog', + 'uw_ct_event', + 'uw_ct_news_item', + ]; + + // Get all the node types. + $node_types = \Drupal::entityTypeManager()->getStorage('node_type')->loadMultiple(); + + // Step through each node type and get the path to + // the module and the machine name. + foreach ($node_types as $node_type) { + + // Get the id from the node type. + $id = $node_type->id(); + + // Ensure we are only getting the node type + // that need updating. + if (!in_array($id, $cts_not_to_install)) { + + // Catalogs and opportunities have different paths + // and ids, so setup the content types array with + // the correct info. + if ($id == 'uw_ct_catalog_item') { + $content_types['uw_ct_catalog'] = $id; + } + elseif ($id == 'uw_ct_opportunity') { + $content_types['uw_ct_opportunities'] = $id; + } + else { + $content_types[$id] = $id; + } + } + } + + // Get the type of media field that we need to udpate. + $type_of_media = current(\Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(['id' => 'node.field_uw_type_of_media'])); + + // Get the type of media settings. + $settings = $type_of_media->getSettings(); + + // Update the settings to remove the allowed values and + // add the allowed values function. + $settings['allowed_values'] = []; + $settings['allowed_values_function'] = '_uw_cfg_common_allowed_media_types'; + + // Set the update settings. + $type_of_media->setSettings($settings); + + // Save the field. + $type_of_media->save(); + + // The names of the fields we need to install. + $names = [ + 'field.storage.node.field_uw_banner', + 'field.storage.node.field_uw_media_width', + 'field.storage.node.field_uw_slide_speed', + 'field.storage.node.field_uw_transition_speed', + 'field.storage.node.field_uw_autoplay', + 'field.storage.node.field_uw_text_overlay_style', + ]; + + // Get the path to cfg common config install directory. + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/install/'; + $config_dir = new FileStorage($path); + + // Step through each of the field names and install them. + foreach ($names as $name) { + + // Get the config from the yml file into an array. + $config_record = $config_dir->read($name); + + // Get the entity type. + $entity_type = \Drupal::service('config.manager')->getEntityTypeIdByName($name); + + // Get the storage. + $storage = \Drupal::entityTypeManager()->getStorage($entity_type); + + // Create the new field from the converted yml. + $field = $storage->createFromStorageRecord($config_record); + + // Save the new field. + $field->save(); + } + + // Step through each of the content types and install the fields, + // and also setup default values for the fields. + foreach ($content_types as $path => $id) { + + // Get the path to the content type. + $path = \Drupal::service('extension.list.module')->getPath($path) . '/config/install/'; + $config_dir = new FileStorage($path); + + // The names of the fields to install. + $names = [ + 'field.field.node.' . $id . '.field_uw_banner', + 'field.field.node.' . $id . '.field_uw_type_of_media', + 'field.field.node.' . $id . '.field_uw_media_width', + 'field.field.node.' . $id . '.field_uw_slide_speed', + 'field.field.node.' . $id . '.field_uw_autoplay', + 'field.field.node.' . $id . '.field_uw_text_overlay_style', + 'field.field.node.' . $id . '.field_uw_transition_speed', + ]; + + // Step through each of the fields and install them. + foreach ($names as $name) { + + // Get the config from the yml into an array. + $config_record = $config_dir->read($name); + + // If the field config is not install, install it. + if (!FieldConfig::loadByName( + $config_record['entity_type'], + $config_record['bundle'], + $config_record['field_name']) + ) { + FieldConfig::create($config_record)->save(); + } + } + + // If there is no media yet on the content type, + // then install the type of hero image field. + if (!in_array($id, $cts_with_media)) { + + // Name of the hero image field. + $name = 'field.field.node.' . $id . '.field_uw_hero_image'; + + // Get the config from the yml into an array. + $config_record = $config_dir->read($name); + + // If the field config is not install, install it. + if (!FieldConfig::loadByName($config_record['entity_type'], $config_record['bundle'], $config_record['field_name'])) { + FieldConfig::create($config_record)->save(); + } + } + + // Get all the nodes of the content type. + $nodes = \Drupal::entityTypeManager()->getStorage('node')->loadByProperties(['type' => $id]); + + // Step through each of the nodes and set the default + // values of the fields. + foreach ($nodes as $node) { + + // Set default values for banners. + $node->field_uw_banner = NULL; + $node->field_uw_media_width = 'uw_lbs_full_width'; + $node->field_uw_slide_speed = 7000; + $node->field_uw_transition_speed = 400; + $node->field_uw_autoplay = TRUE; + $node->field_uw_text_overlay_style = 'full-width'; + + // If the content type does not have media yet, + // set the default value for type of media. + if (!in_array($id, $cts_with_media)) { + $node->field_uw_type_of_media = NULL; + } + + // Save the node. + $node->save(); + } + } + + // Ensure that we have some data to put back in the DB. + if (!empty($node_data)) { + + // Step through all the tables and insert back into + // the database. + foreach ($node_data as $table => $data) { + + // Get all the rows from the table. + foreach ($data as $field_data) { + + // Reset the fields array, so we are working with + // a blank array to insert. + $fields = []; + + // Step through all the entries in the row and add + // to the fields array, this makes it much easier to + // do one insert command. + foreach ($field_data as $key => $value) { + $fields[$key] = $value; + } + + // Insert the row into the database. + $database->insert($table) + ->fields($fields) + ->execute(); + } + } + } +} diff --git a/uw_cfg_common.links.action.yml b/uw_cfg_common.links.action.yml new file mode 100644 index 0000000000000000000000000000000000000000..356432295ac573e90cd6efedc226e8a5d60a1949 --- /dev/null +++ b/uw_cfg_common.links.action.yml @@ -0,0 +1,5 @@ +uw_cfg_common.add_uw_users: + route_name: uw_cfg_common.add_uw_users_form + title: 'Add UWaterloo user(s)' + appears_on: + - entity.user.collection diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index 867e80331b40acb7dbf51b240ea3ff7c52d489fd..4c871802926e8a9b0ec68df68947f34393f5c30d 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -390,6 +390,283 @@ uw_site_management.authenticated_site_settings: menu_name: uw-menu-site-management url: internal:/admin/config/system/auth_site weight: 0 + +uw_content_management.references: + title: 'Publication reference' + menu_name: uw-menu-content-management + url: internal:/dashboard/my_dashboard + weight: 0 + +uw_content_management.references.references: + title: 'Publication reference' + parent: uw_content_management.references + url: internal:/bibcite/reference/add + weight: 0 + +uw_content_management.references.references.list: + title: 'List' + parent: uw_content_management.references.references + url: internal:/admin/content/bibcite/reference + weight: 0 + +uw_content_management.references.references.artwork: + title: 'Add artwork' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/artwork + weight: 1 + +uw_content_management.references.references.audiovisual: + title: 'Add audiovisual' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/audiovisual + weight: 2 + +uw_content_management.references.references.bill: + title: 'Add bill' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/bill + weight: 3 + +uw_content_management.references.references.book: + title: 'Add book' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/book + weight: 4 + +uw_content_management.references.references.book_chapter: + title: 'Add book chapter' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/book_chapter + weight: 5 + +uw_content_management.references.references.broadcast: + title: 'Add broadcast' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/broadcast + weight: 6 + +uw_content_management.references.references.case: + title: 'Add case' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/case + weight: 7 + +uw_content_management.references.references.chart: + title: 'Add chart' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/chart + weight: 8 + +uw_content_management.references.references.classical: + title: 'Add classical' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/classical + weight: 9 + +uw_content_management.references.references.conference_paper: + title: 'Add conference paper' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/conference_paper + weight: 10 + +uw_content_management.references.references.conference_proceedings: + title: 'Add conference proceedings' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/conference_proceedings + weight: 11 + +uw_content_management.references.references.database: + title: 'Add database' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/database + weight: 12 + +uw_content_management.references.references.film: + title: 'Add film' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/film + weight: 13 + +uw_content_management.references.references.government_report: + title: 'Add government report' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/government_report + weight: 14 + +uw_content_management.references.references.hearing: + title: 'Add hearing' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/hearing + weight: 15 + +uw_content_management.references.references.journal: + title: 'Add journal' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/journal + weight: 16 + +uw_content_management.references.references.journal_article: + title: 'Add journal article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/journal_article + weight: 17 + +uw_content_management.references.references.legal_ruling: + title: 'Add legal ruling' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/legal_ruling + weight: 18 + +uw_content_management.references.references.magazine_article: + title: 'Add magazine article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/magazine_article + weight: 19 + +uw_content_management.references.references.manuscript: + title: 'Add manuscript' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/manuscript + weight: 20 + +uw_content_management.references.references.map: + title: 'Add map' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/map + weight: 21 + +uw_content_management.references.references.miscellaneous: + title: 'Add miscellaneous' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/miscellaneous + weight: 22 + +uw_content_management.references.references.miscellaneous_section: + title: 'Add miscellaneous section' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/miscellaneous_section + weight: 23 + +uw_content_management.references.references.newspaper_article: + title: 'Add newspaper article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/newspaper_article + weight: 24 + +uw_content_management.references.references.patent: + title: 'Add patent' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/patent + weight: 25 + +uw_content_management.references.references.personal: + title: 'Add personal' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/personal + weight: 26 + +uw_content_management.references.references.presentation: + title: 'Add presentation' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/presentation + weight: 27 + +uw_content_management.references.references.report: + title: 'Add report' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/report + weight: 28 + +uw_content_management.references.references.software: + title: 'Add software' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/software + weight: 29 + +uw_content_management.references.references.statute: + title: 'Add statute' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/statute + weight: 30 + +uw_content_management.references.references.thesis: + title: 'Add thesis' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/thesis + weight: 31 + +uw_content_management.references.references.unpublished: + title: 'Add unpublished' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/unpublished + weight: 32 + +uw_content_management.references.references.website: + title: 'Add website' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/website + weight: 33 + +uw_content_management.references.references.web_article: + title: 'Add web article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_article + weight: 34 + +uw_content_management.references.references.web_project_page: + title: 'Add web project page' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_project_page + weight: 35 + +uw_content_management.references.references.web_service: + title: 'Add web service' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_service + weight: 36 + +uw_content_management.references.contributors: + title: 'Contributors' + parent: uw_content_management.references + url: internal:/bibcite/contributor/add + weight: 1 + +uw_content_management.references.contributors.list: + title: 'List' + parent: uw_content_management.references.contributors + url: internal:/admin/content/bibcite/contributor + weight: 0 + +uw_content_management.references.keywords: + title: 'Keywords' + parent: uw_content_management.references + url: internal:/bibcite/keyword/add + weight: 2 + +uw_content_management.references.keywords.list: + title: 'List' + parent: uw_content_management.references.keywords + url: internal:/admin/content/bibcite/keyword + weight: 0 + +uw_content_management.references.actions: + title: 'Actions' + parent: uw_content_management.references + url: internal:/admin/content/bibcite/reference/import + weight: 3 + +uw_content_management.references.actions.populate: + title: 'Populate' + parent: uw_content_management.references.actions + url: internal:/admin/content/bibcite/reference/populate + weight: 0 + +uw_content_management.references.actions.export: + title: 'Export' + parent: uw_content_management.references.actions + url: internal:/admin/content/bibcite/reference/export + weight: 1 + uw_site_management.content_access: title: 'Content access' menu_name: uw-menu-site-management @@ -433,7 +710,7 @@ uw_site_management.submit_request: uw_site_management.wcms_how_to_documents: title: 'WCMS how-to documents' menu_name: uw-menu-site-management - url: https://uwaterloo.ca/web-resources/wcms-users/training-and-support/wcms-how-documents + url: https://uwaterloo.ca/web-resources/wcms-3-users/wcms-3-training-and-support/wcms-3-how-documents weight: 0 uw_site_management.manage_all_Media: title: 'Manage all media' diff --git a/uw_cfg_common.links.task.yml b/uw_cfg_common.links.task.yml new file mode 100644 index 0000000000000000000000000000000000000000..de5bc5a7f37f2f0cb49eb95a1d9d5d9a5ebb491b --- /dev/null +++ b/uw_cfg_common.links.task.yml @@ -0,0 +1,11 @@ +# Reference routing definition +entity.bibcite_reference.admin: + title: Publication references + route_name: entity.bibcite_reference.collection + base_route: system.admin_content + weight: 50 + +entity.bibcite_reference.collection: + route_name: entity.bibcite_reference.collection + parent_id: entity.bibcite_reference.admin + title: Publication reference diff --git a/uw_cfg_common.module b/uw_cfg_common.module index dcf4989998145089027c350a032fafa456205093..d3b0b0a9d931f3ba534d9a8807c745a42b7f4bcd 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Access\AccessResult; +use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; @@ -14,6 +15,7 @@ use Drupal\Core\Link; use Drupal\Core\Render\Element; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; +use Drupal\field\Entity\FieldStorageConfig; use Drupal\fillpdf\Controller\HandlePdfController; use Drupal\fillpdf\Form\FillPdfFormForm; use Drupal\media_library\MediaLibraryState; @@ -156,19 +158,6 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) { } } } - - // If there is a type of media, ensure that we do only have - // values in the fields that are selected. - if ($entity->hasField('field_uw_type_of_media')) { - - // Get the type of media. - $type_of_media = $entity->field_uw_type_of_media->value; - - // If it is null then set the hero image to null. - if ($type_of_media == NULL) { - $entity->set('field_uw_hero_image', NULL); - } - } } } @@ -192,6 +181,15 @@ function uw_cfg_common_form_webform_admin_config_submissions_form_alter(array &$ $form['views_settings']['#access'] = FALSE; } +/** + * Implements hook_form_FORM_ID_alter(). + * + * Remove wrapper attributes in admin/structure/webform/manage/{webform_id}. + */ +function uw_cfg_common_form_webform_ui_element_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void { + $form['properties']['wrapper_attributes']['#access'] = FALSE; +} + /** * Implements hook_form_FORM_ID_alter(). * @@ -568,14 +566,58 @@ function uw_cfg_common_preprocess_node(&$variables) { // Return empty render array if user doesn't have access. // $access_result can be boolean or an AccessResult class. - if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) { - return []; + if ( + is_object($access_result) && + $access_result->isForbidden() || + is_bool($access_result) + && $access_result + ) { + + $variables['uw_content_moderation_form'] = $plugin_block->build(); } + } - $render = $plugin_block->build(); + // Set the media flags for the node. + $variables['media_flags'] = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($variables['node'], $variables['view_mode']); +} - $variables['uw_content_moderation_form'] = $render; +/** + * Get the layout builder styles as options. + * + * @param \Drupal\field\Entity\FieldStorageConfig $definition + * The field definition. + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity + * The entity being created if applicable. + * @param bool $cacheable + * Boolean indicating if the results are cacheable. + * + * @return array + * An array of possible key and value options. + * + * @see options_allowed_values() + */ +function _uw_cfg_common_get_layout_builder_styles( + FieldStorageConfig $definition, + ContentEntityInterface $entity = NULL, + $cacheable +) { + + // Get all the styles for sections. + $all_styles = _layout_builder_styles_retrieve_by_type('section'); + // Array of options. + $options = []; + + // Step through each style and get the info. + foreach ($all_styles as $style) { + // Only load styles from the "default" group, + // which contains the section widths. + // Needed for when other section styles ship. + if ($style->getGroup() == 'default') { + $options[$style->id()] = $style->label(); + } } + + return $options; } /** @@ -851,7 +893,10 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } // Ensure that we are on a UW content type node. - if (preg_match('/node_uw.*add_form/', $form_id) || preg_match('/node_uw.*edit_form/', $form_id)) { + if (preg_match('/^node_uw_ct_.*_form$/', $form_id)) { + + // Add custom validation for alias. + $form['#validate'][] = '_uw_cfg_common_alias_validate'; // Ensure that the node has metatag information. if (isset($form['field_uw_meta_tags'])) { @@ -876,6 +921,30 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // on a node add/edit page, so add the states for the // actual media types in the hero section. if (isset($form['field_uw_type_of_media'])) { + + // Get the node type from the form id. + $node_type = str_replace('node_uw_ct_', '', $form_id); + $node_type = str_replace('_edit', '', $node_type); + $node_type = str_replace('_form', '', $node_type); + $node_type = str_replace('_item', '', $node_type); + + // Content types to remove the hero image from media. + $remove_hero_image_nodes = [ + 'web_page', + 'catalog', + 'contact', + 'opportunity', + 'profile', + 'project', + 'service', + ]; + + // If the node type can not have hero image, remove the option. + if (in_array($node_type, $remove_hero_image_nodes)) { + unset($form['field_uw_type_of_media']['widget']['#options']['image']); + } + + // Set the states for the hero image. $form['field_uw_hero_image']['#states'] = [ 'visible' => [ [ @@ -885,6 +954,34 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ], ]; + + // Set the states for the banner. + $form['group_banner']['#states'] = [ + 'visible' => [ + [ + 'select[name="field_uw_type_of_media"]' => [ + ['value' => 'banner'], + ], + ], + ], + ]; + + // Set the states for the banner settings. + $form['field_uw_media_width']['#states'] = [ + 'visible' => [ + [ + 'select[name="field_uw_type_of_media"]' => [ + ['value' => 'banner'], + ], + 'select[name="field_uw_text_overlay_style"]' => [ + ['value' => 'full-width'], + ], + ], + ], + ]; + + // Add our custom validation for banners. + $form['#validate'][] = '_uw_cfg_common_banner_validate'; } // If we are on the media upload form, we want to restrict @@ -931,6 +1028,145 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } } +/** + * Validates submission values for alias on nodes. + */ +function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_state): void { + + // Get the values from the form state. + $values = $form_state->getValues(); + + if (isset($values['path'][0]['alias'])) { + // List of urls which should not be an alias. + $urls = [ + 'blog', + 'events', + 'news', + 'projects', + 'profile', + 'profiles', + 'contacts', + 'service', + 'opportunities', + 'user', + 'users', + ]; + + // Get the alias from the form state values. + $alias = $values['path'][0]['alias']; + $orig_alias = $alias; + + // Trim any surrounding slashes from the alias to + // ensure that we are getting exact matches for the + // predefined alias from above. Some users will add + // slashes before and after the alias, so just + // easier to check without slashes. + $alias = trim($alias, '/'); + + // Check if the alias exists if yes, sets error. + // We are checking three cases, the first is if + // the alias is in the predefined list. The second + // is if the alias is just /, or just a series of slashes, + // we have to check here because we removed all the + // slashes with the alias variable. The last is to check + // if the alias has any form of strictly admin, so /admin/, + // admin, admin/, and admin/something are not allowed, + // but something like admin-meeting would be. + if ( + in_array($alias, $urls) || + preg_match('/^\/+$/', $orig_alias) || + preg_match('/^admin(?:\/.*)?$/', $alias) + ) { + + // Set an error message if alias exists. + $form_state->setError($form['path']['widget'][0]['alias'], t('The alias "@url" is a reserved path that cannot be used.', ['@url' => $orig_alias])); + } + } +} + +/** + * Validates submission values for banners on nodes. + */ +function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_state) { + + // Get the values of the form state. + $values = $form_state->getValues(); + + // If there is a type of media set and it is banners, + // then perform the validation. + if ( + isset($values['field_uw_type_of_media']) && + !empty($values['field_uw_type_of_media']) && + $values['field_uw_type_of_media'][0]['value'] == 'banner' + ) { + + // Since the add more button is in the values, and there is + // a mix of integers and strings as keys, we need to count + // the array keys and if it is less than or equal to one + // means that the user has not entered a banner at all. + if (count(array_keys($values['field_uw_banner'])) <= 1) { + + $form_state->setError($form['field_uw_banner'], t('You must add at least one banner.')); + } + // At least one banner, now check that there is an + // image in each banner. + else { + + // Step through all the values of banners and check for an image. + foreach ($values['field_uw_banner'] as $key => $value) { + + // Ensure that the key is an integer, since there is an add_more + // in the values. We also need to check if there is "top" in the + // array, as this is what paragraphs uses for closed items. These + // closed items have already been validated so if there is a closed + // item we can just ignore it, only open items, meaning it has values + // in the fields needs to be validated. + if (is_int($key) && !$value['top']) { + + // If there is no selection on the media, then there is no image, + // so set the error. + // @todo fix so that inline errors show. + if (!isset($value['subform']['field_uw_ban_image']['selection'])) { + + // Set the error that an image is missing. + $form_state->setError($form['field_uw_banner']['widget'][$key]['subform']['field_uw_ban_image'], t('Banner image field is required.')); + } + } + } + } + } +} + +/** + * Implements hook_field_widget_WIDGET_TYPE_form_alter(). + */ +function uw_cfg_common_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) { + + // If this is a banner image, add the required manually. + if ($element['#paragraph_type'] == 'uw_para_image_banner') { + + // If this is not a block, add the class for required + // on the image, we need to do this so that when using + // banners with media, the required does not work properly + // when banners are not selected. + // If it is a block, just add the required to the element. + if (!isset($context['form']['#block'])) { + + // If there already is classes set, then add to the array. + // If no classes yet, add as an array. + if (isset($element['subform']['field_uw_ban_image']['widget']['#attributes']['class'])) { + $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'][] = 'form-required'; + } + else { + $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'] = ['form-required']; + } + } + else { + $element['subform']['field_uw_ban_image']['widget']['#required'] = TRUE; + } + } +} + /** * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */ @@ -1022,6 +1258,22 @@ function uw_cfg_common_webform_access(WebformInterface $webform, string $operati return AccessResult::forbidden(); } break; + + case 'user': + // Must be authenticated for group auth. + if (!$account->isAuthenticated()) { + return AccessResult::forbidden(); + } + + // Get all users when selecting 'Users specified below' under + // admin/structure/webform/manage/WEBFORM_ID/access. + $create_user_ids = $webform->getAccessRules()['create']['users']; + + // If the logged in user is not a specified user, get access denied. + if (!in_array($account->id(), $create_user_ids)) { + return AccessResult::forbidden(); + } + break; } return AccessResult::neutral(); @@ -1324,3 +1576,30 @@ function uw_cfg_common_preprocess_html(&$variables): void { $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex']; } } + +/** + * Set dynamic allowed values for the type of media field. + * + * @param \Drupal\field\Entity\FieldStorageConfig $definition + * The field definition. + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity + * The entity being created if applicable. + * @param bool $cacheable + * Boolean indicating if the results are cacheable. + * + * @return array + * An array of possible key and value options. + * + * @see options_allowed_values() + */ +function _uw_cfg_common_allowed_media_types( + FieldStorageConfig $definition, + ContentEntityInterface $entity = NULL, + $cacheable +) { + + return [ + 'banner' => 'Banner', + 'image' => 'Image', + ]; +} diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index c5bdcfeba3da3556e9eeaed55ad9a1cd9bc2c929..39f4c65b20afc94d7bddba17e9895970af6dfe17 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -48,3 +48,17 @@ uw_cfg_common.uw_menu_report_csv: _controller: \Drupal\uw_cfg_common\Controller\UwDownloadCsvController::uwMenuReport requirements: _permission: 'view UW CSV reports' +uw_cfg_common.add_uw_users_form: + path: '/admin/add-uwaterloo-users' + defaults: + _title: 'Add UWaterloo user(s)' + _form: '\Drupal\uw_cfg_common\Form\UwAddUsersForm' + requirements: + _permission: 'administer users' +bibcite_import.populate: + path: '/admin/content/bibcite/reference/populate' + defaults: + _form: '\Drupal\bibcite_import\Form\PopulateForm' + _title: 'Populate publication reference values' + requirements: + _permission: 'bibcite populate+administer bibcite' diff --git a/uw_cfg_common.services.yml b/uw_cfg_common.services.yml index 28b61b8481a2f13712ad66e001f919d78e633167..f3b10415e299d7ce7c4c8d436192c021b147bdd9 100644 --- a/uw_cfg_common.services.yml +++ b/uw_cfg_common.services.yml @@ -45,3 +45,7 @@ services: uw_cfg_common.missing_blocks: class: Drupal\uw_cfg_common\Service\UWMissingBlocks arguments: ['@entity_type.manager', '@keyvalue.expirable', '@layout_builder.tempstore_repository'] + uw_cfg_common.webform.event_subscriber: + class: '\Drupal\uw_cfg_common\EventSubscriber\UwWebformEventSubscriber' + tags: + - { name: 'event_subscriber' }