diff --git a/config/install/core.entity_form_display.taxonomy_term.uw_vocab_audience.default.yml b/config/install/core.entity_form_display.taxonomy_term.uw_vocab_audience.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..8d0a4697d3ce43bba73bfb51ab24815beacf58b3 --- /dev/null +++ b/config/install/core.entity_form_display.taxonomy_term.uw_vocab_audience.default.yml @@ -0,0 +1,44 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.uw_vocab_audience + module: + - text +id: taxonomy_term.uw_vocab_audience.default +targetEntityType: taxonomy_term +bundle: uw_vocab_audience +mode: default +content: + description: + type: text_textarea + weight: 1 + region: content + settings: + placeholder: '' + rows: 5 + third_party_settings: { } + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + name: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 3 + region: content + third_party_settings: { } +hidden: + path: true diff --git a/config/install/core.entity_form_display.user.user.default.yml b/config/install/core.entity_form_display.user.user.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..8dc67d81c6a90e69b4a27755aeffb343ad2b989e --- /dev/null +++ b/config/install/core.entity_form_display.user.user.default.yml @@ -0,0 +1,66 @@ +langcode: en +status: true +dependencies: + config: + - field.field.user.user.field_uw_first_name + - field.field.user.user.field_uw_last_name + module: + - path + - user +id: user.user.default +targetEntityType: user +bundle: user +mode: default +content: + account: + weight: 2 + region: content + settings: { } + third_party_settings: { } + contact: + weight: 5 + region: content + settings: { } + third_party_settings: { } + field_uw_first_name: + weight: 0 + settings: + size: 60 + placeholder: '' + third_party_settings: + maxlength: + maxlength_js: null + maxlength_js_label: 'Content limited to @limit characters, remaining: <strong>@remaining</strong>' + type: string_textfield + region: content + field_uw_last_name: + weight: 1 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + language: + weight: 4 + region: content + settings: { } + third_party_settings: { } + path: + type: path + weight: 7 + region: content + settings: { } + third_party_settings: { } + simplesamlphp_auth_user_enable: + weight: 3 + region: content + settings: { } + third_party_settings: { } + timezone: + weight: 6 + region: content + settings: { } + third_party_settings: { } +hidden: + langcode: true diff --git a/config/install/core.entity_view_display.user.user.default.yml b/config/install/core.entity_view_display.user.user.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..2fc5c7dd6b9fecfcc5e6071a586b4aff73a879dc --- /dev/null +++ b/config/install/core.entity_view_display.user.user.default.yml @@ -0,0 +1,42 @@ +langcode: en +status: true +dependencies: + config: + - field.field.user.user.field_uw_first_name + - field.field.user.user.field_uw_last_name + module: + - user +id: user.user.default +targetEntityType: user +bundle: user +mode: default +content: + field_uw_first_name: + weight: 0 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_last_name: + weight: 1 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + member_for: + weight: 2 + region: content + settings: { } + third_party_settings: { } + role_expire: + weight: 3 + region: content + settings: { } + third_party_settings: { } +hidden: + langcode: true + realname: true diff --git a/config/install/editor.editor.uw_tf_full_html.yml b/config/install/editor.editor.uw_tf_full_html.yml index ddaba766ba1c3d8a19dd0f86fd4e4b666060a942..ccece780cfdd8088c18963901c935d553356420e 100644 --- a/config/install/editor.editor.uw_tf_full_html.yml +++ b/config/install/editor.editor.uw_tf_full_html.yml @@ -31,6 +31,10 @@ settings: items: - BulletedList - NumberedList + - + name: Inserts + items: + - Mathjax - name: Media items: @@ -48,6 +52,7 @@ settings: - Source - Table - SpecialChar + - Mathjax - Maximize - PasteText - PasteFromWord diff --git a/config/install/editor.editor.uw_tf_standard.yml b/config/install/editor.editor.uw_tf_standard.yml index 530194ba56c730c6e58427fac02c885d4d34e867..64687d4ea60f5f5d40463c5fa3dd73442613fe36 100644 --- a/config/install/editor.editor.uw_tf_standard.yml +++ b/config/install/editor.editor.uw_tf_standard.yml @@ -44,6 +44,10 @@ settings: items: - DrupalLink - DrupalUnlink + - + name: Inserts + items: + - Mathjax - name: Styles items: diff --git a/config/install/field.field.user.user.field_uw_first_name.yml b/config/install/field.field.user.user.field_uw_first_name.yml new file mode 100644 index 0000000000000000000000000000000000000000..15573b2d50c4e02cc0b49be1992fe135d89de5a6 --- /dev/null +++ b/config/install/field.field.user.user.field_uw_first_name.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.user.field_uw_first_name + module: + - user +id: user.user.field_uw_first_name +field_name: field_uw_first_name +entity_type: user +bundle: user +label: 'First name' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.user.user.field_uw_last_name.yml b/config/install/field.field.user.user.field_uw_last_name.yml new file mode 100644 index 0000000000000000000000000000000000000000..229d504158d8696ec65e173721e3940558c487ad --- /dev/null +++ b/config/install/field.field.user.user.field_uw_last_name.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.user.field_uw_last_name + module: + - user +id: user.user.field_uw_last_name +field_name: field_uw_last_name +entity_type: user +bundle: user +label: 'Last name' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.storage.node.field_uw_meta_description.yml b/config/install/field.storage.node.field_uw_meta_description.yml new file mode 100644 index 0000000000000000000000000000000000000000..343115b1e958ceb788c9ade89ee45ca29d31bc39 --- /dev/null +++ b/config/install/field.storage.node.field_uw_meta_description.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_meta_description +field_name: field_uw_meta_description +entity_type: node +type: string_long +settings: + 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.node.field_uw_meta_image.yml b/config/install/field.storage.node.field_uw_meta_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..75783571c4f438b4c8d98219e8fe8ed4060001a4 --- /dev/null +++ b/config/install/field.storage.node.field_uw_meta_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_uw_meta_image +field_name: field_uw_meta_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_meta_tags.yml b/config/install/field.storage.node.field_uw_meta_tags.yml new file mode 100644 index 0000000000000000000000000000000000000000..b90d964c56ae327a777750a60ba0cc058afb91b3 --- /dev/null +++ b/config/install/field.storage.node.field_uw_meta_tags.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - metatag + - node +id: node.field_uw_meta_tags +field_name: field_uw_meta_tags +entity_type: node +type: metatag +settings: { } +module: metatag +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.user.field_uw_first_name.yml b/config/install/field.storage.user.field_uw_first_name.yml new file mode 100644 index 0000000000000000000000000000000000000000..7d9e6270c8265a667b4f56c01b2c74d915775978 --- /dev/null +++ b/config/install/field.storage.user.field_uw_first_name.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - user +id: user.field_uw_first_name +field_name: field_uw_first_name +entity_type: user +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.user.field_uw_last_name.yml b/config/install/field.storage.user.field_uw_last_name.yml new file mode 100644 index 0000000000000000000000000000000000000000..18a97c24329b820bcf05eb4664ee56c6c819dd01 --- /dev/null +++ b/config/install/field.storage.user.field_uw_last_name.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - user +id: user.field_uw_last_name +field_name: field_uw_last_name +entity_type: user +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/filter.format.uw_tf_basic.yml b/config/install/filter.format.uw_tf_basic.yml index 09e0eb3b4d5e370b3832cc9c5550c359f56fe91a..6f53277d67545ebfe7e0cae9046e7d9e59d51f54 100644 --- a/config/install/filter.format.uw_tf_basic.yml +++ b/config/install/filter.format.uw_tf_basic.yml @@ -81,5 +81,5 @@ filters: weight: -40 settings: default_view_mode: default - allowed_media_types: { } allowed_view_modes: { } + allowed_media_types: { } diff --git a/config/install/filter.format.uw_tf_full_html.yml b/config/install/filter.format.uw_tf_full_html.yml index 024eeb59dcd59da42be55bf99cf5987ea2a375eb..654695477b26a1a3f4faa15f403c0538c6c4e909 100644 --- a/config/install/filter.format.uw_tf_full_html.yml +++ b/config/install/filter.format.uw_tf_full_html.yml @@ -31,8 +31,8 @@ filters: weight: -48 settings: default_view_mode: default - allowed_media_types: { } allowed_view_modes: { } + allowed_media_types: { } editor_file_reference: id: editor_file_reference provider: editor diff --git a/config/install/filter.format.uw_tf_standard.yml b/config/install/filter.format.uw_tf_standard.yml index e7ab4394a53885c9b921ce77fa6262977ead7afc..843e41cc09b438806fa3519dbe3ede7664ecb078 100644 --- a/config/install/filter.format.uw_tf_standard.yml +++ b/config/install/filter.format.uw_tf_standard.yml @@ -15,7 +15,7 @@ filters: status: true weight: -46 settings: - allowed_html: '<a class href hreflang download rel rev name target<_self> <img src alt longdesc width height> <uwvideo href> <table width> <th abbr axis headers scope colspan rowspan width> <td abbr axis headers scope colspan rowspan width> <colgroup span width> <col span width> <div data-reveal-id tabindex role> <abbr/acronym> <sub> <sup> <dfn> <samp> <kbd> <var> <ol start> <em> <i> <strong> <b> <strike> <s> <del> <ins> <footer> <cite> <blockquote> <address> <code> <pre> <ul> <li value> <dl> <dt> <dd> <p class> <h2> <h3> <h4> <h5> <h6> <span><thead> <tfoot> <tbody> <tr> <caption> <hr> <br> <ckcalltoaction data-calltoaction-nid> <cktwitter data-type data-username data-listname data-search data-displayname data-widget-id data-tweet data-url data-timeline> <ckfacebook data-username data-displayname> <ckfactsfigures data-factsfigures-nid data-usecarousel data-numberpercarousel> <ckimagegallery data-imagegallerynid data-gallerytype> <cklivestream data-username data-displayname> <ckmailchimp data-sourcecode> <ckmailman data-listname data-servername> <cktableau data-url data-height data-tabs data-server data-site> <cktdx data-tdx-id data-tdx-show-project-title> <cktint data-id data-keywords data-height data-columns> <cktimeline data-restfulurl> <ckvimeo data-url> <ckembeddedmaps data-type data-src data-height> <ckhootsuite data-subdomain data-height> <div title id lang class=" "><drupal-media data-entity-type data-entity-uuid data-view-mode data-align data-caption alt title>' + allowed_html: '<a class href hreflang download rel rev name target<_self> <img src alt longdesc width height> <uwvideo href> <table width> <th abbr axis headers scope colspan rowspan width> <td abbr axis headers scope colspan rowspan width> <colgroup span width> <col span width> <div data-reveal-id tabindex role> <abbr/acronym> <sub> <sup> <dfn> <samp> <kbd> <var> <ol start> <em> <i> <strong> <b> <strike> <s> <del> <ins> <footer> <cite> <blockquote> <address> <code> <pre> <ul> <li value> <dl> <dt> <dd> <p class> <h2> <h3> <h4> <h5> <h6> <span><span class><thead> <tfoot> <tbody> <tr> <caption> <hr> <br> <ckcalltoaction data-calltoaction-nid> <cktwitter data-type data-username data-listname data-search data-displayname data-widget-id data-tweet data-url data-timeline> <ckfacebook data-username data-displayname> <ckfactsfigures data-factsfigures-nid data-usecarousel data-numberpercarousel> <ckimagegallery data-imagegallerynid data-gallerytype> <cklivestream data-username data-displayname> <ckmailchimp data-sourcecode> <ckmailman data-listname data-servername> <cktableau data-url data-height data-tabs data-server data-site> <cktdx data-tdx-id data-tdx-show-project-title> <cktint data-id data-keywords data-height data-columns> <cktimeline data-restfulurl> <ckvimeo data-url> <ckembeddedmaps data-type data-src data-height> <ckhootsuite data-subdomain data-height> <div title id lang class=" "><drupal-media data-entity-type data-entity-uuid data-view-mode data-align data-caption alt title>' filter_html_help: true filter_html_nofollow: true filter_htmlcorrector: @@ -74,10 +74,10 @@ filters: weight: -43 settings: default_view_mode: default + allowed_view_modes: { } allowed_media_types: uw_mt_file: uw_mt_file uw_mt_image: uw_mt_image - allowed_view_modes: { } linkit: id: linkit provider: linkit diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_blockquote.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_blockquote.yml new file mode 100644 index 0000000000000000000000000000000000000000..d2940f002bbdb677f6ad5ed6e9968472b548f109 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_blockquote.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_blockquote +block_id: 'inline_block:uw_cbl_blockquote' +category: uw_bc_content +label: Blockquote +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/blockquote.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_call_to_action.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_call_to_action.yml new file mode 100644 index 0000000000000000000000000000000000000000..c6c1ad2afe25f40ea90612db19ec497282dd358d --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_call_to_action.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_call_to_action +block_id: 'inline_block:uw_cbl_call_to_action' +category: uw_bc_content +label: 'Call to action' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/calltoaction.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_copy_text.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_copy_text.yml new file mode 100644 index 0000000000000000000000000000000000000000..050e055ed8a0c9b88946dcabb7b2c8fcfbdc91ae --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_copy_text.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_copy_text +block_id: 'inline_block:uw_cbl_copy_text' +category: uw_bc_content +label: 'Copy text' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/copytext.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_facts_and_figures.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_facts_and_figures.yml new file mode 100644 index 0000000000000000000000000000000000000000..60f6644520b95cef396eabb878696d52bf602066 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_facts_and_figures.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_facts_and_figures +block_id: 'inline_block:uw_cbl_facts_and_figures' +category: uw_bc_content +label: 'Facts and figures' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/factsandfigures.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_google_maps.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_google_maps.yml new file mode 100644 index 0000000000000000000000000000000000000000..c81579fafb8428f5403f1682b8222d9112f3789f --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_google_maps.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_google_maps +block_id: 'inline_block:uw_cbl_google_maps' +category: uw_bc_external_embeds +label: 'Google Maps' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/maps_google.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image.yml new file mode 100644 index 0000000000000000000000000000000000000000..fcd3b920755918abe5d4aa7721a2b323c8e9956e --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_image +block_id: 'inline_block:uw_cbl_image' +category: uw_bc_content +label: 'Full width image' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/fullwidthimage.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image_gallery.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image_gallery.yml new file mode 100644 index 0000000000000000000000000000000000000000..a95a2bfd41eee106e8f5127fb08d2c01f4a7741f --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_image_gallery.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_image_gallery +block_id: 'inline_block:uw_cbl_image_gallery' +category: uw_bc_content +label: 'Image gallery' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/imagegallery.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_instagram.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_instagram.yml new file mode 100644 index 0000000000000000000000000000000000000000..609dfea60adbf015eeda7ccb9a11df0ebb0325a4 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_instagram.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_instagram +block_id: 'inline_block:uw_cbl_instagram' +category: uw_bc_external_embeds +label: Instagram +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/instagram.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_mailman.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_mailman.yml new file mode 100644 index 0000000000000000000000000000000000000000..44375e9d953fda1267ef550bdc1e94b56b2dba49 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_mailman.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_mailman +block_id: 'inline_block:uw_cbl_mailman' +category: uw_bc_content +label: 'Mailman subscription' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/mailman.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_powerbi.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_powerbi.yml new file mode 100644 index 0000000000000000000000000000000000000000..2e27ee7e116172b386b15205df6a398b228da544 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_powerbi.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_powerbi +block_id: 'inline_block:uw_cbl_powerbi' +category: uw_bc_external_embeds +label: PowerBI +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/powerbi.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_related_links.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_related_links.yml new file mode 100644 index 0000000000000000000000000000000000000000..4ab46d5216fd49d50d060ca74456812fe0248ec5 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_related_links.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_related_links +block_id: 'inline_block:uw_cbl_related_links' +category: uw_bc_content +label: 'Related links' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/relatedlinks.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_remote_video.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_remote_video.yml new file mode 100644 index 0000000000000000000000000000000000000000..066e24a192b60eae075d66bb555563a2420afa9e --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_remote_video.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_remote_video +block_id: 'inline_block:uw_cbl_remote_video' +category: uw_bc_external_embeds +label: 'Remote video' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/video.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_tableau.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_tableau.yml new file mode 100644 index 0000000000000000000000000000000000000000..5b805e6ee2a78911bfb3c0a3ab90b4f8dd301bd6 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_tableau.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_tableau +block_id: 'inline_block:uw_cbl_tableau' +category: uw_bc_external_embeds +label: 'Tableau visualization' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/tableau.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_timeline.yml b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_timeline.yml new file mode 100644 index 0000000000000000000000000000000000000000..c3568219b76062f45cca589fb792f2096de3477d --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.inline_blockuw_cbl_timeline.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: inline_blockuw_cbl_timeline +block_id: 'inline_block:uw_cbl_timeline' +category: uw_bc_content +label: Timeline +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/timeline.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_blog_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_blog_teaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..a9a6240f40fb6cca2fddc2fa2cc4b1038fd62415 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_blog_teaser.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_cbl_blog_teaser +block_id: uw_cbl_blog_teaser +category: uw_bc_teasers +label: 'Blog post teaser' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/blogteaser.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_event_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_event_teaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..ec0dd77bbceec2c1d782cab46164f05b446166f3 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_event_teaser.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_cbl_event_teaser +block_id: uw_cbl_event_teaser +category: uw_bc_teasers +label: 'Event teaser' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/eventteaser.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_multi_type_list.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_multi_type_list.yml new file mode 100644 index 0000000000000000000000000000000000000000..9d1413e14f26f20a171c2ff07055ac4bb6baea2d --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_multi_type_list.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_cbl_multi_type_list +block_id: uw_cbl_multi_type_list +category: uw_bc_listings +label: 'Multi-type list' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/multitypelist.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_news_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_news_teaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..70d08b1e2262674c9302ba477f78f9adddee4a8b --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_cbl_news_teaser.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_cbl_news_teaser +block_id: uw_cbl_news_teaser +category: uw_bc_teasers +label: 'News item teaser' +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/newsteaser.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_facebook.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_facebook.yml new file mode 100644 index 0000000000000000000000000000000000000000..db494a588fa2731a9fd819d41f8a5ef0f718386c --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_facebook.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_facebook +block_id: uw_cbl_facebook +category: uw_bc_external_embeds +label: Facebook +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/facebook.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_twitter.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_twitter.yml new file mode 100644 index 0000000000000000000000000000000000000000..2feb374d77f9ebde9514f1d1e10d4515b335e302 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_twitter.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_twitter +block_id: uw_cbl_twitter +category: uw_bc_external_embeds +label: Twitter +weight: -4 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/twitter.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_blogs-blogs_listing_block.yml b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_blogs-blogs_listing_block.yml new file mode 100644 index 0000000000000000000000000000000000000000..e25b492c411516d517eb6080b64bb72ac4fb9062 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_blogs-blogs_listing_block.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: views_blockuw_view_blogs-blogs_listing_block +block_id: 'views_block:uw_view_blogs-blogs_listing_block' +category: uw_bc_listings +label: 'Blog post list' +weight: -2 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/bloglist.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_events-events_listing_block.yml b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_events-events_listing_block.yml new file mode 100644 index 0000000000000000000000000000000000000000..bce7da409041713ade0ae0ef90d2214546f67cbe --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_events-events_listing_block.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: views_blockuw_view_events-events_listing_block +block_id: 'views_block:uw_view_events-events_listing_block' +category: uw_bc_listings +label: 'Event list' +weight: -1 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/eventlist.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_news_items-news_items_listing_block.yml b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_news_items-news_items_listing_block.yml new file mode 100644 index 0000000000000000000000000000000000000000..8f336c6b9d18757f1679cac151b6bd45c2edda24 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.views_blockuw_view_news_items-news_items_listing_block.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: views_blockuw_view_news_items-news_items_listing_block +block_id: 'views_block:uw_view_news_items-news_items_listing_block' +category: uw_bc_listings +label: 'News item list' +weight: 1 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/newslist.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.webform_block.yml b/config/install/layout_builder_browser.layout_builder_browser_block.webform_block.yml new file mode 100644 index 0000000000000000000000000000000000000000..7b2e4e8e82eb1b93aff0c97d23cd39cbfcd5a2a9 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.webform_block.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: webform_block +block_id: webform_block +category: uw_bc_webforms +label: Webform +weight: 0 +image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/webform.svg +image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_content.yml b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_content.yml index 2f22cae3d2f8003862e2e75fd38b07cf35d073be..afd64e30980e8474f554e647dbc2e01cc317d1aa 100755 --- a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_content.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_content.yml @@ -8,44 +8,45 @@ blocks: - block_id: 'inline_block:uw_cbl_blockquote' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/blockquote.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/blockquote.svg image_alt: '' - block_id: 'inline_block:uw_cbl_call_to_action' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/calltoaction.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/calltoaction.svg image_alt: '' - block_id: 'inline_block:uw_cbl_copy_text' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/copytext.svg - image_alt: '' - - - block_id: 'inline_block:uw_cbl_expand_collapse' - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/expandcollapse.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/copytext.svg image_alt: '' - block_id: 'inline_block:uw_cbl_facts_and_figures' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/factsandfigures.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/factsandfigures.svg image_alt: '' - block_id: 'inline_block:uw_cbl_image' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/fullwidthimage.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/fullwidthimage.svg image_alt: '' - - block_id: 'inline_block:uw_cbl_image_gallery' + - + block_id: 'inline_block:uw_cbl_image_gallery' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/imagegallery.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/imagegallery.svg image_alt: '' - block_id: 'inline_block:uw_cbl_mailman' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/mailman.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/mailman.svg image_alt: '' - block_id: 'inline_block:uw_cbl_related_links' weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/relatedlinks.svg + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/relatedlinks.svg + image_alt: '' + - + block_id: 'inline_block:uw_cbl_timeline' + weight: 0 + image_path: /themes/uw_fdsu_theme_resp/images/layout_builder_browser/timeline.svg image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_listings.yml b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_listings.yml index fa5261c0c2f5320b10b1d3dfb20a600fd6998ff2..4b089a384cf89a1478e8c1b69e4896639d9495ec 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_listings.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_listings.yml @@ -4,24 +4,3 @@ dependencies: { } id: uw_bc_listings label: Listings weight: null -blocks: - - - block_id: 'views_block:uw_view_blogs-blogs_listing_block' - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/bloglist.svg - image_alt: '' - - - block_id: 'views_block:uw_view_events-events_listing_block' - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/eventlist.svg - image_alt: '' - - - block_id: 'views_block:uw_view_news_items-news_items_listing_block' - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/newslist.svg - image_alt: '' - - - block_id: uw_cbl_multi_type_list - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/multitypelist.svg - image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_teasers.yml b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_teasers.yml index 02458cf188ed0d4f117daf609bb5a4db162c5ab7..5d3350eeb942588ddc737064f3b21adf60e81adf 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_teasers.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_teasers.yml @@ -4,19 +4,3 @@ dependencies: { } id: uw_bc_teasers label: Teasers weight: null -blocks: - - - block_id: uw_cbl_blog_teaser - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/blogteaser.svg - image_alt: '' - - - block_id: uw_cbl_news_teaser - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/newsteaser.svg - image_alt: '' - - - block_id: uw_cbl_event_teaser - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/eventteaser.svg - image_alt: '' diff --git a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_webforms.yml b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_webforms.yml index 1ea273fac06822ab3dcf7a0d11bc0fc008fac778..73d11669a6125aabfd5c06883e2a5b280ec29cfb 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_webforms.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_blockcat.uw_bc_webforms.yml @@ -4,9 +4,3 @@ dependencies: { } id: uw_bc_webforms label: Webforms weight: null -blocks: - - - block_id: webform_block - weight: 0 - image_path: /profiles/uw_base_profile/themes/uw_fdsu_theme_resp/images/layout_builder_browser/webform.svg - image_alt: '' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml index 00d757054e514454e182dd90405f75a856b4dc7f..f352744a8d0750d8b3c40ee3cc05688edc348ce3 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml @@ -5,6 +5,6 @@ id: uw_lbs_carousel_1_item label: 'Carousel - 1 item' classes: uw-carousel--one-item type: component -weight: 0 +weight: -10 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml index 88c8d085caf7885e417a1ead64cd36567f1e0b5e..c4ead54d79f455d60c1c580169cbcb90c236c075 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml @@ -5,6 +5,6 @@ id: uw_lbs_carousel_2_items label: 'Carousel - 2 items' classes: uw-carousel--two-items type: component -weight: 0 +weight: -9 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml index 2d9265f7a2b2f0bd6a7bc97d88ab4a593128955f..8f05eb8ad0eb2b363eaddd8e4bce4ddd73aa4cf6 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml @@ -5,6 +5,6 @@ id: uw_lbs_carousel_3_items label: 'Carousel - 3 items' classes: uw-carousel--three-items type: component -weight: 0 +weight: -8 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' 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 37924349abf05d8d30bf4179aec9b5c82276ac5c..ff8a94c649edf1aebd06f7315c7d964b85ec4606 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,6 +5,6 @@ id: uw_lbs_carousel_4_items label: 'Carousel - 4 items' classes: uw-carousel--four-items type: component -weight: 0 +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 dddabf08494157f790f04db76280e21652b2ce1e..d026b96db6e4033c488295975c61e4c37152dbfc 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 @@ -2,10 +2,10 @@ langcode: en status: true dependencies: { } id: uw_lbs_contained_width -label: 'Contained width' +label: 'Extra-wide contained width' classes: uw-contained-width type: section -weight: 0 +weight: -4 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml new file mode 100644 index 0000000000000000000000000000000000000000..133375c0cb99387511babafe1ba5cab3eff401e8 --- /dev/null +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbs_contained_width_narrow +label: 'Narrow contained width' +classes: "uw-contained-width\r\nuw-contained-width--narrow" +type: section +weight: -6 +block_restrictions: { } diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml new file mode 100644 index 0000000000000000000000000000000000000000..bd262e70d9aa34894a652e1538880e5cd320080b --- /dev/null +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbs_contained_width_wide +label: 'Wide contained width' +classes: "uw-contained-width\r\nuw-contained-width--wide" +type: section +weight: -5 +block_restrictions: { } 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 1f92dcc2c47c56c16c1e89aeaff8f67db931b903..6854f4af206808986a8aa195c85de38c78ee654b 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 @@ -5,7 +5,7 @@ id: uw_lbs_full_width label: 'Full width' classes: uw-full-width type: section -weight: 0 +weight: -3 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' diff --git a/config/install/metatag.settings.yml b/config/install/metatag.settings.yml new file mode 100644 index 0000000000000000000000000000000000000000..acdfeb2b7da6b7db6bab034ba50e9e80e986b647 --- /dev/null +++ b/config/install/metatag.settings.yml @@ -0,0 +1,44 @@ +entity_type_groups: + node: + uw_ct_blog: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_article: schema_article + uw_ct_catalog_item: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_web_page: schema_web_page + uw_ct_contact: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_web_page: schema_person + uw_ct_event: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_event: schema_event + uw_ct_news_item: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_article: schema_article + uw_ct_profile: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_web_page: schema_person + uw_ct_web_page: + basic: basic + advanced: advanced + open_graph: open_graph + twitter_cards: twitter_cards + schema_web_page: schema_web_page diff --git a/config/install/realname.settings.yml b/config/install/realname.settings.yml new file mode 100644 index 0000000000000000000000000000000000000000..5ea4e42de93fdc157f89bc1fbaa7e946e85110fc --- /dev/null +++ b/config/install/realname.settings.yml @@ -0,0 +1 @@ +pattern: '[user:field_uw_first_name] [user:field_uw_last_name]' diff --git a/config/install/user.role.anonymous.yml b/config/install/user.role.anonymous.yml index 3d01ac9df3d27935feb4a2fdae8bbb1c377d6700..d0dc1b6ddb54d65b045168d25967633771de679c 100644 --- a/config/install/user.role.anonymous.yml +++ b/config/install/user.role.anonymous.yml @@ -21,3 +21,4 @@ permissions: - 'view paragraph content uw_para_fact_text' - 'view paragraph content uw_para_facts_and_figures' - 'view paragraph content uw_para_ff' + - 'view paragraph content uw_para_timeline' diff --git a/config/install/user.role.authenticated.yml b/config/install/user.role.authenticated.yml index 1c4c2893cecf32d6867e99dcf428f0d1ae2f6eb6..fbc3f939737763f7c27c80aaa246f51807b077ac 100644 --- a/config/install/user.role.authenticated.yml +++ b/config/install/user.role.authenticated.yml @@ -15,6 +15,9 @@ permissions: - 'skip CAPTCHA' - 'use text format uw_tf_basic' - 'use text format uw_tf_standard' + - 'userprotect.account.edit' + - 'userprotect.mail.edit' + - 'userprotect.pass.edit' - 'view media' - 'view paragraph content uw_para_call_to_action' - 'view paragraph content uw_para_call_to_action_text' @@ -24,4 +27,5 @@ permissions: - 'view paragraph content uw_para_fact_text' - 'view paragraph content uw_para_facts_and_figures' - 'view paragraph content uw_para_ff' + - 'view paragraph content uw_para_timeline' - 'view the administration theme' diff --git a/config/install/user.role.uw_role_content_author.yml b/config/install/user.role.uw_role_content_author.yml index 980e028dc15c4434aad9c26b9a270db182377a41..d9d05e8ed698637df5cbf3d33325da758e83a8f5 100644 --- a/config/install/user.role.uw_role_content_author.yml +++ b/config/install/user.role.uw_role_content_author.yml @@ -17,7 +17,6 @@ permissions: - 'access taxonomy overview' - 'access uw_ebr_image entity browser pages' - 'administer main menu items' - - 'administer special alert' - 'administer uw-menu-audience-menu menu items' - 'can override my_dashboard dashboard' - 'can view my_dashboard dashboard' @@ -38,6 +37,7 @@ permissions: - 'create paragraph content uw_para_fact_text' - 'create paragraph content uw_para_facts_and_figures' - 'create paragraph content uw_para_ff' + - 'create paragraph content uw_para_timeline' - 'create terms in uw_tax_event_tags' - 'create terms in uw_tax_event_type' - 'create terms in uw_vocab_audience' @@ -47,6 +47,7 @@ permissions: - 'create terms in uw_vocab_news_tags' - 'create url aliases' - 'create uw_ct_blog content' + - 'create uw_ct_catalog_item content' - 'create uw_ct_event content' - 'create uw_ct_news_item content' - 'create uw_ct_sidebar content' @@ -62,13 +63,16 @@ permissions: - '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_timeline' - 'edit any uw_ct_blog content' + - 'edit any uw_ct_catalog_item content' - 'edit any uw_ct_event content' - 'edit any uw_ct_news_item content' - 'edit any uw_ct_sidebar content' - 'edit any uw_ct_site_footer content' - 'edit any uw_ct_web_page content' - 'edit own uw_ct_blog content' + - 'edit own uw_ct_catalog_item content' - 'edit own uw_ct_event content' - 'edit own uw_ct_news_item content' - 'edit own uw_ct_sidebar content' @@ -85,6 +89,7 @@ permissions: - 'make smart dates recur' - 'reschedule smart date recur instances' - 'revert uw_ct_blog revisions' + - 'revert uw_ct_catalog_item revisions' - 'revert uw_ct_event revisions' - 'revert uw_ct_news_item revisions' - 'revert uw_ct_sidebar revisions' @@ -99,6 +104,7 @@ permissions: - 'update paragraph content uw_para_fact_text' - 'update paragraph content uw_para_facts_and_figures' - 'update paragraph content uw_para_ff' + - 'update paragraph content uw_para_timeline' - 'use uw_workflow transition needs_review' - 'use workbench access' - 'view all media revisions' @@ -109,6 +115,7 @@ permissions: - 'view own unpublished media' - 'view unpublished paragraphs' - 'view uw_ct_blog revisions' + - 'view uw_ct_catalog_item revisions' - 'view uw_ct_event revisions' - 'view uw_ct_news_item revisions' - 'view uw_ct_sidebar revisions' diff --git a/config/install/user.role.uw_role_content_editor.yml b/config/install/user.role.uw_role_content_editor.yml index 269b69361e42eb29232df67531afb284db7925f4..b55010b913c8d4216a1b4222d915af393c3c72df 100644 --- a/config/install/user.role.uw_role_content_editor.yml +++ b/config/install/user.role.uw_role_content_editor.yml @@ -18,7 +18,6 @@ permissions: - 'access taxonomy overview' - 'access uw_ebr_image entity browser pages' - 'administer main menu items' - - 'administer special alert' - 'administer uw-menu-audience-menu menu items' - 'can override my_dashboard dashboard' - 'can view my_dashboard dashboard' @@ -39,6 +38,7 @@ permissions: - 'create paragraph content uw_para_fact_text' - 'create paragraph content uw_para_facts_and_figures' - 'create paragraph content uw_para_ff' + - 'create paragraph content uw_para_timeline' - 'create terms in uw_tax_event_tags' - 'create terms in uw_tax_event_type' - 'create terms in uw_vocab_audience' @@ -48,6 +48,7 @@ permissions: - 'create terms in uw_vocab_news_tags' - 'create url aliases' - 'create uw_ct_blog content' + - 'create uw_ct_catalog_item content' - 'create uw_ct_event content' - 'create uw_ct_news_item content' - 'create uw_ct_sidebar content' @@ -63,13 +64,16 @@ permissions: - '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_timeline' - 'edit any uw_ct_blog content' + - 'edit any uw_ct_catalog_item content' - 'edit any uw_ct_event content' - 'edit any uw_ct_news_item content' - 'edit any uw_ct_sidebar content' - 'edit any uw_ct_site_footer content' - 'edit any uw_ct_web_page content' - 'edit own uw_ct_blog content' + - 'edit own uw_ct_catalog_item content' - 'edit own uw_ct_event content' - 'edit own uw_ct_news_item content' - 'edit own uw_ct_sidebar content' @@ -86,6 +90,7 @@ permissions: - 'make smart dates recur' - 'reschedule smart date recur instances' - 'revert uw_ct_blog revisions' + - 'revert uw_ct_catalog_item revisions' - 'revert uw_ct_event revisions' - 'revert uw_ct_news_item revisions' - 'revert uw_ct_sidebar revisions' @@ -100,6 +105,7 @@ permissions: - 'update paragraph content uw_para_fact_text' - 'update paragraph content uw_para_facts_and_figures' - 'update paragraph content uw_para_ff' + - 'update paragraph content uw_para_timeline' - 'use uw_workflow transition archived' - 'use uw_workflow transition draft' - 'use uw_workflow transition needs_review' @@ -113,6 +119,7 @@ permissions: - 'view own unpublished media' - 'view unpublished paragraphs' - 'view uw_ct_blog revisions' + - 'view uw_ct_catalog_item revisions' - 'view uw_ct_event revisions' - 'view uw_ct_news_item revisions' - 'view uw_ct_sidebar revisions' diff --git a/config/install/user.role.uw_role_site_manager.yml b/config/install/user.role.uw_role_site_manager.yml index c99b9fcb043fcb2c59e960e76b6c2b30f663eb1b..6931fc4e09cdda02ce0f4110469a2f2b506a9eca 100644 --- a/config/install/user.role.uw_role_site_manager.yml +++ b/config/install/user.role.uw_role_site_manager.yml @@ -7,6 +7,7 @@ weight: -6 is_admin: null permissions: - 'access administration pages' + - 'access content access form' - 'access content overview' - 'access contextual links' - 'access files overview' @@ -40,6 +41,7 @@ permissions: - 'create paragraph content uw_para_fact_text' - 'create paragraph content uw_para_facts_and_figures' - 'create paragraph content uw_para_ff' + - 'create paragraph content uw_para_timeline' - 'create terms in uw_tax_event_tags' - 'create terms in uw_tax_event_type' - 'create terms in uw_vocab_audience' @@ -49,6 +51,7 @@ permissions: - 'create terms in uw_vocab_news_tags' - 'create url aliases' - 'create uw_ct_blog content' + - 'create uw_ct_catalog_item content' - 'create uw_ct_event content' - 'create uw_ct_news_item content' - 'create uw_ct_sidebar content' @@ -58,6 +61,7 @@ permissions: - 'delete all revisions' - 'delete any media' - 'delete any uw_ct_blog content' + - 'delete any uw_ct_catalog_item content' - 'delete any uw_ct_event content' - 'delete any uw_ct_news_item content' - 'delete any uw_ct_sidebar content' @@ -66,6 +70,7 @@ permissions: - 'delete any uw_news_item content' - 'delete orphan revisions' - 'delete own uw_ct_blog content' + - 'delete own uw_ct_catalog_item content' - 'delete own uw_ct_event content' - 'delete own uw_ct_news_item content' - 'delete own uw_ct_sidebar content' @@ -80,6 +85,7 @@ permissions: - '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_timeline' - 'delete terms in uw_tax_event_tags' - 'delete terms in uw_tax_event_type' - 'delete terms in uw_vocab_audience' @@ -89,6 +95,7 @@ permissions: - 'delete terms in uw_vocab_news_tags' - 'delete uw_news_item revisions' - 'edit any uw_ct_blog content' + - 'edit any uw_ct_catalog_item content' - 'edit any uw_ct_event content' - 'edit any uw_ct_news_item content' - 'edit any uw_ct_sidebar content' @@ -96,6 +103,7 @@ permissions: - 'edit any uw_ct_web_page content' - 'edit any uw_news_item content' - 'edit own uw_ct_blog content' + - 'edit own uw_ct_catalog_item content' - 'edit own uw_ct_event content' - 'edit own uw_ct_news_item content' - 'edit own uw_ct_sidebar content' @@ -113,6 +121,7 @@ permissions: - 'reschedule smart date recur instances' - 'revert all revisions' - 'revert uw_ct_blog revisions' + - 'revert uw_ct_catalog_item revisions' - 'revert uw_ct_event revisions' - 'revert uw_ct_news_item revisions' - 'revert uw_ct_sidebar revisions' @@ -128,6 +137,7 @@ permissions: - 'update paragraph content uw_para_fact_text' - 'update paragraph content uw_para_facts_and_figures' - 'update paragraph content uw_para_ff' + - 'update paragraph content uw_para_timeline' - 'use uw_workflow transition archived' - 'use uw_workflow transition draft' - 'use uw_workflow transition needs_review' @@ -141,6 +151,7 @@ permissions: - 'view own unpublished media' - 'view unpublished paragraphs' - 'view uw_ct_blog revisions' + - 'view uw_ct_catalog_item revisions' - 'view uw_ct_event revisions' - 'view uw_ct_news_item revisions' - 'view uw_ct_sidebar revisions' diff --git a/config/install/user.role.uw_role_site_owner.yml b/config/install/user.role.uw_role_site_owner.yml index 7a6e21c7e7283285d99aa399b87c0a1ba9d13953..9c4e9499e1bff363ec4cf667045cab81a5d4ed51 100644 --- a/config/install/user.role.uw_role_site_owner.yml +++ b/config/install/user.role.uw_role_site_owner.yml @@ -17,7 +17,9 @@ permissions: - 'administer main menu items' - 'administer role expire' - 'administer shortcuts' + - 'administer users' - 'administer uw-menu-audience-menu menu items' + - 'assign roles' - 'can override my_dashboard dashboard' - 'can view my_dashboard dashboard' - 'create and edit custom blocks' diff --git a/config/install/userprotect.rule.uw_protect_authenticated_user.yml b/config/install/userprotect.rule.uw_protect_authenticated_user.yml new file mode 100644 index 0000000000000000000000000000000000000000..bc435657823c39791e5a73ee46ce95a966d19a56 --- /dev/null +++ b/config/install/userprotect.rule.uw_protect_authenticated_user.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - user.role.authenticated + module: + - user +name: uw_protect_authenticated_user +label: 'Authenticated user' +protectedEntityTypeId: user_role +protectedEntityId: authenticated +protections: + user_delete: + id: user_delete + provider: userprotect + status: true + user_status: + id: user_status + provider: userprotect + status: true diff --git a/config/optional/linkit.linkit_profile.default.yml b/config/optional/linkit.linkit_profile.default.yml index 82ba378eefccb1871460357ff2e76e923c3df8fe..aca913e2a8d96cf58ceb40df2515387bf993c4f9 100644 --- a/config/optional/linkit.linkit_profile.default.yml +++ b/config/optional/linkit.linkit_profile.default.yml @@ -12,9 +12,14 @@ matchers: id: 'entity:node' weight: 0 settings: - metadata: 'by [node:author] | [node:created:long]' + metadata: '[node:content-type] by [node:author] | [node:created:long] (node [node:nid])' bundles: { } group_by_bundle: false include_unpublished: false substitution_type: canonical limit: 100 + 6104a100-f463-4c40-8bde-6c442591afe7: + uuid: 6104a100-f463-4c40-8bde-6c442591afe7 + id: email + weight: 0 + settings: { } diff --git a/layouts/uw-1-col/layout--uw-1-col.html.twig b/layouts/uw-1-col/layout--uw-1-col.html.twig index 2e66e82b304b15973889b2c361e11ee811294522..dec62b584bd451ac064f2b77f29a16de62ebcd85 100644 --- a/layouts/uw-1-col/layout--uw-1-col.html.twig +++ b/layouts/uw-1-col/layout--uw-1-col.html.twig @@ -7,11 +7,7 @@ %} <section{{ attributes.addClass(classes) }}> - <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> {{ content.first }} - </div> </div> - </section> diff --git a/layouts/uw-2-col/layout--uw-2-col.html.twig b/layouts/uw-2-col/layout--uw-2-col.html.twig index d940ff0698083c4be068eb727bcfdb0bbdcb0558..2ea4739882a1ed7abeb827ea0f5e0bc904f58785 100644 --- a/layouts/uw-2-col/layout--uw-2-col.html.twig +++ b/layouts/uw-2-col/layout--uw-2-col.html.twig @@ -9,15 +9,11 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> </section> diff --git a/layouts/uw-3-col/layout--uw-3-col.html.twig b/layouts/uw-3-col/layout--uw-3-col.html.twig index 81aae1afd92c16aa2581cdc0775577acbe27931c..e3874ab307d2de4694917c91f060730e14847b7b 100644 --- a/layouts/uw-3-col/layout--uw-3-col.html.twig +++ b/layouts/uw-3-col/layout--uw-3-col.html.twig @@ -9,21 +9,15 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> - <div class="layout__region--wrapper"> - {{ content.third }} - </div> + {{ content.third }} </div> </section> diff --git a/layouts/uw-4-col/layout--uw-4-col.html.twig b/layouts/uw-4-col/layout--uw-4-col.html.twig index dfc2dabd213932210d6a7f7d0ac7dffaca0d500f..d98de7c115e8f969817b601e67bfdf5c6b9efda2 100644 --- a/layouts/uw-4-col/layout--uw-4-col.html.twig +++ b/layouts/uw-4-col/layout--uw-4-col.html.twig @@ -9,27 +9,19 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> - <div class="layout__region--wrapper"> - {{ content.third }} - </div> + {{ content.third }} </div> <div {{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}> - <div class="layout__region--wrapper"> - {{ content.fourth }} - </div> + {{ content.fourth }} </div> </section> diff --git a/layouts/uw-5-col/layout--uw-5-col.html.twig b/layouts/uw-5-col/layout--uw-5-col.html.twig index 69e3be2f1587cdb37ec4eb0809160fc2f2a4370f..13f0fadf68ce1615900a2c4baf1ef9d08a3f93ad 100644 --- a/layouts/uw-5-col/layout--uw-5-col.html.twig +++ b/layouts/uw-5-col/layout--uw-5-col.html.twig @@ -9,33 +9,23 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> - <div class="layout__region--wrapper"> - {{ content.third }} - </div> + {{ content.third }} </div> <div {{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.fifth.addClass('layout__region', 'layout__region--fifth') }}> - <div class="layout__region--wrapper"> - {{ content.fifth }} - </div> + {{ content.fifth }} </div> </section> diff --git a/layouts/uw-inverted-l-left/layout--uw-inverted-l-left.html.twig b/layouts/uw-inverted-l-left/layout--uw-inverted-l-left.html.twig index efc824c4e4c8bf7cf32c53b5d9713d09ee687a27..b6cc5fca74c82e16d0a228eb5718dbdb0cd5be31 100644 --- a/layouts/uw-inverted-l-left/layout--uw-inverted-l-left.html.twig +++ b/layouts/uw-inverted-l-left/layout--uw-inverted-l-left.html.twig @@ -9,27 +9,19 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> - <div class="layout__region--wrapper"> - {{ content.third }} - </div> + {{ content.third }} </div> <div {{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}> - <div class="layout__region--wrapper"> - {{ content.fourth }} - </div> + {{ content.fourth }} </div> </section> diff --git a/layouts/uw-inverted-l-right/layout--uw-inverted-l-right.html.twig b/layouts/uw-inverted-l-right/layout--uw-inverted-l-right.html.twig index 50e6bca853fae7b44868158cba6c063e1a3e20ae..ef5e9c7ad874e18698e8f92355457f7cf29287c8 100644 --- a/layouts/uw-inverted-l-right/layout--uw-inverted-l-right.html.twig +++ b/layouts/uw-inverted-l-right/layout--uw-inverted-l-right.html.twig @@ -9,27 +9,19 @@ <section{{ attributes.addClass(classes) }}> <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> - <div class="layout__region--wrapper"> - {{ content.first }} - </div> + {{ content.first }} </div> <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> - <div class="layout__region--wrapper"> - {{ content.second }} - </div> + {{ content.second }} </div> <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> - <div class="layout__region--wrapper"> - {{ content.third }} - </div> + {{ content.third }} </div> <div {{ region_attributes.fourth.addClass('layout__region', 'layout__region--fourth') }}> - <div class="layout__region--wrapper"> - {{ content.fourth }} - </div> + {{ content.fourth }} </div> </section> diff --git a/layouts/uw-inverted-l-right/uw-layout-inverted-l-right.css b/layouts/uw-inverted-l-right/uw-layout-inverted-l-right.css index 54a5da7f7bcf00411706e477a2118162e92522d0..97b0651fa597d5ad1d8bb7c7913aa047ab83a488 100644 --- a/layouts/uw-inverted-l-right/uw-layout-inverted-l-right.css +++ b/layouts/uw-inverted-l-right/uw-layout-inverted-l-right.css @@ -43,4 +43,4 @@ box-shadow: none; border: 1px solid #bfbfba; padding: 1rem; -} \ No newline at end of file +} diff --git a/src/Access/UwNodeAccessCheck.php b/src/Access/UwNodeAccessCheck.php index a805775f5510f755a9ab42e27dd72fbb7a022b33..0c190d08124f36fd1c0aa2452cc26451742b536e 100644 --- a/src/Access/UwNodeAccessCheck.php +++ b/src/Access/UwNodeAccessCheck.php @@ -17,7 +17,7 @@ class UwNodeAccessCheck implements AccessInterface { * A custom access check. * * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * + * Route matching. * @param \Drupal\Core\Session\AccountInterface $account * Run access checks for this account. * @@ -29,22 +29,26 @@ class UwNodeAccessCheck implements AccessInterface { // Get the node object, which is in the route match variable. $node = $route_match->getParameter('node'); - // Check if this is a sidebar content type and if the user has permission to edit the content type. - // We want to throw a 404 (NotFoundHttpException) if they do not have access. This is the case when - // a user is not logged in, and when they do not have permission to edit it. + // Check if this is a sidebar content type and if the user has permission + // to edit the content type. We want to throw a 404 (NotFoundHttpException) + // if they do not have access. This is the case when a user is not logged + // in, and when they do not have permission to edit it. if ($node && $node->bundle() == 'uw_ct_sidebar' && !$account->hasPermission('edit any uw_ct_sidebar content')) { throw new NotFoundHttpException(); } - // Check if this is a sidebar content type and if the user has permission to edit the content type. - // We want to throw a 404 (NotFoundHttpException) if they do not have access. This is the case when - // a user is not logged in, and when they do not have permission to edit it. + // Check if this is a sidebar content type and if the user has permission + // to edit the content type. We want to throw a 404 (NotFoundHttpException) + // if they do not have access. This is the case when a user is not logged + // in, and when they do not have permission to edit it. if ($node && $node->bundle() == 'uw_ct_site_footer' && !$account->hasPermission('edit any uw_ct_site_footer content')) { throw new NotFoundHttpException(); } - // We have to return some type of access, so we are going to return allowed, if they do not have access, - // the new exception is going to be thrown above. + // We have to return some type of access, so we are going to return + // allowed, if they do not have access, the new exception is going to be + // thrown above. return AccessResult::allowed(); } + } diff --git a/src/Form/UwContentModerationForm.php b/src/Form/UwContentModerationForm.php new file mode 100644 index 0000000000000000000000000000000000000000..d7b8876cf890ab8883ea8ea067afa85f0a08c304 --- /dev/null +++ b/src/Form/UwContentModerationForm.php @@ -0,0 +1,246 @@ +<?php + +namespace Drupal\uw_cfg_common\Form; + +use Drupal\Core\Access\AccessResult; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Form\ConfirmFormBase; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Url; +use Drupal\uw_cfg_common\Service\UWService; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Form class for the content access form. + */ +class UwContentModerationForm extends ConfirmFormBase { + + /** + * The entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * The nid (node id). + * + * @var int + */ + protected $nid; + + /** + * The vid (version id). + * + * @var int + */ + protected $vid; + + /** + * Class constructor. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager. + */ + public function __construct(EntityTypeManagerInterface $entity_type_manager) { + $this->entityTypeManager = $entity_type_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + // Instantiates this form class. + return new static( + $container->get('entity_type.manager') + ); + } + + /** + * Access callback. No access for the home page, except by admin. + * + * @return object + * A AccessResult object. + */ + public function access(int $nid, AccountInterface $account): AccessResult { + if (UWService::nodeIsHomePage($nid) && !$account->hasPermission('bypass home page protection')) { + return AccessResult::forbidden(); + } + return AccessResult::allowed(); + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'uw_content_moderation_form'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state, $nid = NULL, $vid = NULL, $status = NULL) { + + // Set the node, version id and status. + $this->nid = $nid; + $this->vid = $vid; + $this->status = $status; + + // Get the form from the parent, we need this to ensure + // that we have all the components (like confirm/cancel) + // load with this form as well. + $form = parent::buildForm($form, $form_state); + + // Unset the description, we want to replace it with our + // description based on the node status. + unset($form['description']); + + // Set the description form element. + $form['description'] = [ + '#type' => 'markup', + ]; + + // Set the description based on the node status. + if ($this->status) { + $form['description']['#markup'] = $this->t('Are you sure that you want to unpublish the live revision of this content?'); + } + else { + $form['description']['#markup'] = $this->t('Are you sure that you want to publish the current revision of this content?'); + } + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + + // If we are unpublishing, load the latest revision node. + if ($this->status) { + + // Load the node with the nid. + $node = $this->entityTypeManager->getStorage('node')->load($this->nid); + + // Get all the revisions for the current node. + $revision_ids = $this->entityTypeManager->getStorage('node')->revisionIds($node); + + // Get the node object with that latest revision, which is the end + // of the revision ids list. + $node = $this->entityTypeManager->getStorage('node')->loadRevision(end($revision_ids)); + } + + // If we are publishing, load the node with the nid. + else { + + // Get the node object. + $node = $this->entityTypeManager->getStorage('node')->loadRevision($this->vid); + } + + // If the node is currently published, then we want to + // unpublish this content, which will mean to move from + // two statesL upublish and draft. + if ($this->status) { + + // First set the node to unpublished, we need to do this + // because moving it to just draft will not cause it to + // become unpublished. + $node->set('moderation_state', 'uw_wf_unpublished'); + + // Save the node to move it to unpublished. + $saved_status = $node->save(); + + // Now set the node moderation state to draft. + $node->set('moderation_state', 'draft'); + + // Save the node with the moderation state at draft. + $saved_status = $node->save(); + } + + // If the node is already unpublished, we want to move to the + // published moderation state. + else { + + // Set the moderation state to publish. + $node->set('moderation_state', 'published'); + + // Save the node with the moderation state at published. + $saved_status = $node->save(); + } + + // Set the options for the URL. + $options = ['absolute' => TRUE]; + + // Return the URL back to the node. + $url = Url::fromRoute('entity.node.canonical', ['node' => $this->nid], $options); + + // Adding the redirect back to the node. + $form_state->setRedirectUrl($url); + + // If the saved status is SAVED_UPDATED (2), means that we successfully + // changed the moderation state so set the message appropriately. + if ($saved_status == SAVED_UPDATED) { + + if ($this->status) { + $this->messenger()->addStatus($this->t('You have successfully unpublished this content.')); + } + else { + $this->messenger()->addStatus($this->t('You have successfully published this content.')); + } + } + + // If the saved status is anything else, there was an + // error trying to change the moderation state so set + // the message appropriately. + else { + + if ($this->status) { + $this->messenger()->addError($this->t('There was an error trying to unpublish this content.')); + } + else { + $this->messenger()->addError($this->t('There was an error trying to publish this content.')); + } + } + } + + /** + * Returns the question to ask the user. + * + * @return \Drupal\Core\StringTranslation\TranslatableMarkup + * The form question. The page title will be set to this value. + */ + public function getQuestion() { + + // Get the node object. + $node = $this->entityTypeManager->getStorage('node')->load($this->nid); + + // Set the question (title of page) based on node status. + if ($this->status) { + + // Return the question to see if they want to publish the node. + return $this->t('Unpublish %node_title?', ['%node_title' => $node->getTitle()]); + } + else { + + // Return the question to see if they want to publish the node. + return $this->t('Publish %node_title?', ['%node_title' => $node->getTitle()]); + } + } + + /** + * Returns the route to go to if the user cancels the action. + * + * @return \Drupal\Core\Url + * A URL object. + */ + public function getCancelUrl() { + + // Set the options for the URL. + $options = ['absolute' => TRUE]; + + // Return the URL back to the node. + return Url::fromRoute('entity.node.canonical', ['node' => $this->nid], $options); + } + +} diff --git a/src/Plugin/CKEditorPlugin/ClipboardPlugin.php b/src/Plugin/CKEditorPlugin/ClipboardPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..390a7b94f28fa93162303740d3609d80a576c3e6 --- /dev/null +++ b/src/Plugin/CKEditorPlugin/ClipboardPlugin.php @@ -0,0 +1,73 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\editor\Entity\Editor; +use Drupal\Core\Asset\LibrariesDirectoryFileFinder; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Defines the "clipboard" plugin. + * + * @CKEditorPlugin( + * id = "clipboard", + * label = @Translation("Clipboard") + * ) + */ +class ClipboardPlugin extends CKEditorPluginBase implements ContainerFactoryPluginInterface { + + /** + * Library file finder. + * + * @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder + */ + protected $libFileFinder; + + /** + * Constructs a BlockComponentRenderArray object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder + * The library file finder. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->libFileFinder = $libFileFinder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder')); + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + return []; + } + + /** + * {@inheritdoc} + */ + public function getFile() { + return $this->libFileFinder->find('ckeditor-clipboard') . '/plugin.js'; + } + +} diff --git a/src/Plugin/CKEditorPlugin/DialogPlugin.php b/src/Plugin/CKEditorPlugin/DialogPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..8246f835d1a1f332489e462a679f6809b5ea4ad0 --- /dev/null +++ b/src/Plugin/CKEditorPlugin/DialogPlugin.php @@ -0,0 +1,73 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\Core\Asset\LibrariesDirectoryFileFinder; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\editor\Entity\Editor; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Defines the "dialog" plugin. + * + * @CKEditorPlugin( + * id = "dialog", + * label = @Translation("Dialog") + * ) + */ +class DialogPlugin extends CKEditorPluginBase implements ContainerFactoryPluginInterface { + + /** + * Library file finder. + * + * @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder + */ + protected $libFileFinder; + + /** + * Constructs a BlockComponentRenderArray object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder + * The library file finder. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->libFileFinder = $libFileFinder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder')); + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + return []; + } + + /** + * {@inheritdoc} + */ + public function getFile() { + return $this->libFileFinder->find('ckeditor-dialog') . '/plugin.js'; + } + +} diff --git a/src/Plugin/CKEditorPlugin/LineutilsPlugin.php b/src/Plugin/CKEditorPlugin/LineutilsPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..d405ce0b8b939c79513f0c0f24f62345e6c2220e --- /dev/null +++ b/src/Plugin/CKEditorPlugin/LineutilsPlugin.php @@ -0,0 +1,73 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\Core\Asset\LibrariesDirectoryFileFinder; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\editor\Entity\Editor; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Defines the "lineutils" plugin. + * + * @CKEditorPlugin( + * id = "lineutils", + * label = @Translation("Line Utilities") + * ) + */ +class LineutilsPlugin extends CKEditorPluginBase implements ContainerFactoryPluginInterface { + + /** + * Library file finder. + * + * @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder + */ + protected $libFileFinder; + + /** + * Constructs a BlockComponentRenderArray object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder + * The library file finder. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->libFileFinder = $libFileFinder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder')); + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + return []; + } + + /** + * {@inheritdoc} + */ + public function getFile() { + return $this->libFileFinder->find('ckeditor-lineutils') . '/plugin.js'; + } + +} diff --git a/src/Plugin/CKEditorPlugin/MathJaxPlugin.php b/src/Plugin/CKEditorPlugin/MathJaxPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..c8e0eadd7e88b6c156cb51f00711d215cacbc847 --- /dev/null +++ b/src/Plugin/CKEditorPlugin/MathJaxPlugin.php @@ -0,0 +1,99 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\editor\Entity\Editor; +use Drupal\Core\Asset\LibrariesDirectoryFileFinder; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Defines the "mathjax" plugin. + * + * @CKEditorPlugin( + * id = "mathjax", + * label = @Translation("Mathjax") + * ) + */ +class MathJaxPlugin extends CKEditorPluginBase implements ContainerFactoryPluginInterface { + + /** + * Library file finder. + * + * @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder + */ + protected $libFileFinder; + + /** + * Constructs a BlockComponentRenderArray object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder + * The library file finder. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->libFileFinder = $libFileFinder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder')); + } + + /** + * {@inheritdoc} + */ + public function getDependencies(Editor $editor) { + return [ + 'clipboard', + 'dialog', + 'lineutils', + 'widget', + ]; + } + + /** + * {@inheritdoc} + */ + public function getLibraries(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return [ + 'mathJaxLib' => '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML', + ]; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + return [ + 'Mathjax' => [ + 'label' => $this->t('Math'), + 'image' => $this->libFileFinder->find('ckeditor-mathjax') . '/icons/mathjax.png', + ], + ]; + } + + /** + * {@inheritdoc} + */ + public function getFile() { + return $this->libFileFinder->find('ckeditor-mathjax') . '/plugin.js'; + } + +} diff --git a/src/Plugin/CKEditorPlugin/WidgetPlugin.php b/src/Plugin/CKEditorPlugin/WidgetPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..e824fff43c01f85915c992e565b5d31d54b39a3a --- /dev/null +++ b/src/Plugin/CKEditorPlugin/WidgetPlugin.php @@ -0,0 +1,73 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin; + +use Drupal\ckeditor\CKEditorPluginBase; +use Drupal\Core\Asset\LibrariesDirectoryFileFinder; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\editor\Entity\Editor; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Defines the "widget" plugin. + * + * @CKEditorPlugin( + * id = "widget", + * label = @Translation("Widget") + * ) + */ +class WidgetPlugin extends CKEditorPluginBase implements ContainerFactoryPluginInterface { + + /** + * Library file finder. + * + * @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder + */ + protected $libFileFinder; + + /** + * Constructs a BlockComponentRenderArray object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder + * The library file finder. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, LibrariesDirectoryFileFinder $libFileFinder) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->libFileFinder = $libFileFinder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static($configuration, $plugin_id, $plugin_definition, $container->get('library.libraries_directory_file_finder')); + } + + /** + * {@inheritdoc} + */ + public function getConfig(Editor $editor) { + return []; + } + + /** + * {@inheritdoc} + */ + public function getButtons() { + return []; + } + + /** + * {@inheritdoc} + */ + public function getFile() { + return $this->libFileFinder->find('ckeditor-widget') . '/plugin.js'; + } + +} diff --git a/src/Plugin/Layout/Uw2ColumnLayout.php b/src/Plugin/Layout/Uw2ColumnLayout.php index e1516e8a3e23bb321671ec90ecc79b89b041ebe2..eb4916305640466cbfcea96d02df1fa948953d4d 100644 --- a/src/Plugin/Layout/Uw2ColumnLayout.php +++ b/src/Plugin/Layout/Uw2ColumnLayout.php @@ -34,4 +34,5 @@ class Uw2ColumnLayout extends UwColumnLayoutBase { return $form; } + } diff --git a/src/Plugin/Layout/Uw3ColumnLayout.php b/src/Plugin/Layout/Uw3ColumnLayout.php index 84171c80f70b76d079e27aaace7816c01eccd7e1..308cc01ff3c8d570379baf881b6e96bd9472eeb5 100644 --- a/src/Plugin/Layout/Uw3ColumnLayout.php +++ b/src/Plugin/Layout/Uw3ColumnLayout.php @@ -37,4 +37,5 @@ class Uw3ColumnLayout extends UwColumnLayoutBase { return $form; } + } diff --git a/src/Plugin/Layout/Uw4ColumnLayout.php b/src/Plugin/Layout/Uw4ColumnLayout.php index de8260e5aeb334a06d426ea8124ae0f1fabee09e..c4c655ec5e7c4e957ca3a5fd63e87b9aa0fa7d5a 100644 --- a/src/Plugin/Layout/Uw4ColumnLayout.php +++ b/src/Plugin/Layout/Uw4ColumnLayout.php @@ -37,4 +37,5 @@ class Uw4ColumnLayout extends UwColumnLayoutBase { return $form; } + } diff --git a/src/Plugin/Layout/UwColumnLayoutBase.php b/src/Plugin/Layout/UwColumnLayoutBase.php index 299833fe1dbac07c8acfb152b7c55c037a3a0643..06460ba4d740a6c49e53351e75a137bb5b53674f 100644 --- a/src/Plugin/Layout/UwColumnLayoutBase.php +++ b/src/Plugin/Layout/UwColumnLayoutBase.php @@ -17,7 +17,10 @@ class UwColumnLayoutBase extends LayoutDefault implements PluginFormInterface { public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { // Set the column class in the config. - $this->configuration['column_class'] = $form_state->getValue(['layout_settings', 'column_class'], NULL); + $this->configuration['column_class'] = $form_state->getValue( + ['layout_settings', 'column_class'], + NULL + ); } /** diff --git a/src/Routing/UwNodeAccessRouteSubscriber.php b/src/Routing/UwNodeAccessRouteSubscriber.php index 2b7f39544af31d0d2d09dd57be0dbdfa01cdaf92..d5309c69fe257f4c71aa0fda8cb7e26e726d9c83 100644 --- a/src/Routing/UwNodeAccessRouteSubscriber.php +++ b/src/Routing/UwNodeAccessRouteSubscriber.php @@ -1,23 +1,23 @@ -<?php - -namespace Drupal\uw_cfg_common\Routing; - -use Drupal\Core\Routing\RouteSubscriberBase; -use Symfony\Component\Routing\RouteCollection; - -/** - * Listens to the dynamic route events. - */ -class UwNodeAccessRouteSubscriber extends RouteSubscriberBase { - - /** - * {@inheritdoc} - */ - protected function alterRoutes(RouteCollection $collection) { - // Change the route associated with node (/node/{nid}). - if ($route = $collection->get('entity.node.canonical')) { - $route->setRequirement('_custom_access', 'Drupal\uw_cfg_common\Access\UwNodeAccessCheck::access'); - } - } - -} \ No newline at end of file +<?php + +namespace Drupal\uw_cfg_common\Routing; + +use Drupal\Core\Routing\RouteSubscriberBase; +use Symfony\Component\Routing\RouteCollection; + +/** + * Listens to the dynamic route events. + */ +class UwNodeAccessRouteSubscriber extends RouteSubscriberBase { + + /** + * {@inheritdoc} + */ + protected function alterRoutes(RouteCollection $collection) { + // Change the route associated with node (/node/{nid}). + if ($route = $collection->get('entity.node.canonical')) { + $route->setRequirement('_custom_access', 'Drupal\uw_cfg_common\Access\UwNodeAccessCheck::access'); + } + } + +} diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 821964d7cc5176495b78e77006f90b37fb1c3f92..1f021d59cfbb5f3d975c8baf674639a7be9c2cbd 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -3,16 +3,57 @@ namespace Drupal\uw_cfg_common\Service; use Drupal\Core\Entity\EntityInterface; -use Drupal\node\Entity\Node; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\node\NodeInterface; +use Drupal\Core\Database\Connection; +use Drupal\simplify_menu\MenuItems; /** - * Class UWService + * Class UWService. + * + * UW Service that holds common functionality used by uw blocks. * * @package Drupal\uw_cfg_common\Service */ class UWService implements UWServiceInterface { + /** + * Entity type manager from core. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + private $entityTypeManager; + + /** + * Database connection. + * + * @var \Drupal\Core\Database\Connection + */ + private $database; + + /** + * Simplify_menu menu items. + * + * @var \Drupal\simplify_menu\MenuItems + */ + private $simplifyMenu; + + /** + * Default constructor. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager + * Entity Type Manager from core. + * @param \Drupal\Core\Database\Connection $database + * The database entity. + * @param \Drupal\simplify_menu\MenuItems $simplifyMenu + * The simplify_menu menu items. + */ + public function __construct(EntityTypeManagerInterface $entityTypeManager, Connection $database, MenuItems $simplifyMenu) { + $this->entityTypeManager = $entityTypeManager; + $this->database = $database; + $this->simplifyMenu = $simplifyMenu; + } + /** * {@inheritDoc} */ @@ -76,10 +117,17 @@ class UWService implements UWServiceInterface { // field_uw_<content_type>_date. $field_name = 'field_uw_' . trim($teaser_type) . '_date'; - // Set the date variable, once returned to the calling function, they - // can change the date format as required (i.e. change it to long-date - // or date-time). - $variables['date'] = $node->$field_name->getString(); + if (trim($teaser_type) == 'event') { + $variables['date'] = $node->$field_name->getValue(); + } + else { + + // Set the date variable, once returned to the calling function, + // they can change the date format as required (i.e. change it + // to long-date or date-time). + $variables['date'] = $node->$field_name->getString(); + } + break; case 'author': @@ -157,4 +205,216 @@ class UWService implements UWServiceInterface { return $variables; } + /** + * {@inheritDoc} + */ + public function getOrCheckAttachedSidebar(int $attached_page_nid, int $sidebar_nid = NULL, string $type = NULL): int { + + // A database called to get the field with the condition of the + // attached_page_nid. + $result = $this->database + ->select('node__field_uw_attach_page', 'nfuap') + ->fields('nfuap', ['entity_id', 'field_uw_attach_page_target_id']) + ->condition('field_uw_attach_page_target_id', $attached_page_nid); + + // If we are doing a a check for sidebar, then add the condition + // that it is not equal to the current sidebar_nid that we are on. + // Meaning that we are checking for any other sidebars that this + // attached_page_nid is attached to. + if ($type == 'check') { + + // Add the not equals to condition. + $result->condition('entity_id', $sidebar_nid, '<>'); + } + + // Get the results of query, we only need to fetch, because we are + // only every expecting one sidebar only has one other node page + // attached. + $results = $result->execute()->fetch(); + + // If we have results, then return the entity_id, which is the + // sidebar_nid that the attached_page_nid is attached to. + if (isset($results->entity_id)) { + + // Return the entity_id. + return $results->entity_id; + } + + // If we made it here, there are no other sidebars that the + // attached_page_nid is attached to, so we can simply return 0. + else { + return 0; + } + } + + /** + * {@inheritDoc} + */ + public function getUwContentTypes($with_sidebar = FALSE): array { + $return_content_types = []; + + // This is the list of all UW content types, with a TRUE/FALSE, indicating + // whether or not a sidebar can be attached to this content type. + $content_types = [ + 'uw_ct_blog' => TRUE, + 'uw_ct_catalog_item' => FALSE, + 'uw_ct_event' => TRUE, + 'uw_ct_news_item' => TRUE, + 'uw_ct_sidebar' => FALSE, + 'uw_ct_site_footer' => FALSE, + 'uw_ct_web_page' => TRUE, + ]; + + foreach ($content_types as $key => $value) { + if ($with_sidebar && $value) { + $return_content_types[] = $key; + } + elseif (!$with_sidebar) { + $return_content_types[] = $key; + } + } + + return $return_content_types; + } + + /** + * {@inheritDoc} + */ + public function uwGetMenu(string $menu_name = 'main', bool $count_menu_items = FALSE, bool $include_parent_in_count = FALSE): array { + + // Get the main menu from the simplify menu module. + $menu = $this->simplifyMenu->getMenuTree($menu_name); + + // Set it to the menu_tree which is done by simplify menu. + $menu = $menu['menu_tree']; + + // If we want to have the count of menu items, then count them. + if ($count_menu_items) { + + // Add the count of the menu items. + $menu = $this->uwSetMenuItems($menu, $include_parent_in_count); + } + + return $menu; + } + + /** + * {@inheritDoc} + */ + public function uwSetMenuItems(array $menus, bool $include_parent_in_count = FALSE): array { + + // Step through the menu and do a few things: + // (a) Remove the Home link (this will be a house icon) + // (b) Add the number of menu items per menu link. + foreach ($menus as $index => $menu) { + + // If this is the Home link, then remove it. + if ($menu['text'] == "Home") { + + // Remove the home link. + unset($menus[$index]); + } + + // If we are not on the home link, then add the number + // of menu items in this menu link. + else { + + // Set the menu_item_count, initially to 0. + $menu_items_count = 0; + + // If there is a submenu, recursivley call the count function. + if (isset($menu['submenu']) && count($menu['submenu']) > 0) { + + // Call the count function recursively till we have the number of + // menu items. + $this->uwCountMenuItems($menu['submenu'], $menu_items_count); + + // Set the menu items count. + // If we need to include the parent in the count, for example the + // main menu will print the parent inside the tray, then we increment + // the menu items count by 1. + if ($include_parent_in_count) { + $menu_items_count++; + } + + // Set the menu items count in the menu. + $menus[$index]['menu_items_count'] = $menu_items_count; + + } + + // If there are no submenus, the count is 0, there will be no tray. + else { + + // Set the number of items count, which is 0. + $menus[$index]['menu_items_count'] = $menu_items_count; + } + } + } + + return $menus; + } + + /** + * {@inheritDoc} + */ + public function uwCountMenuItems($menus, &$menu_items_count): void { + + // Step through the menus and check for submenus and count. + foreach ($menus as $menu) { + + // Increment the menu items counter. + $menu_items_count++; + + // If there is a submenu, recursivley call the count function. + if (isset($menu['submenu']) && count($menu['submenu']) > 0) { + + // Recursively check the submenu. + $this->uwCountMenuItems($menu['submenu'], $menu_items_count); + + } + } + } + + /** + * Determine whether a node is the home page. + * + * @param int $nid + * A node ID. + * + * @return bool + * TRUE when the node is the home page, FALSE otherwise. + */ + public static function nodeIsHomePage(int $nid): bool { + $front_page_path = \Drupal::configFactory()->get('system.site')->get('page.front'); + $node_alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid); + return $front_page_path === $node_alias; + } + + /** + * {@inheritDoc} + */ + public function uwMonthNameShort(int $month = NULL) { + + static $months = [ + 1 => 'Jan.', + 2 => 'Feb.', + 3 => 'Mar.', + 4 => 'Apr.', + 5 => 'May', + 6 => 'June', + 7 => 'July', + 8 => 'Aug.', + 9 => 'Sep.', + 10 => 'Oct.', + 11 => 'Nov.', + 12 => 'Dec.', + ]; + if ($month) { + return $months[$month]; + } + else { + return $months; + } + } + } diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php index 360bbf854105a40e71b107adc78dc807751d1b78..93714b1bc5e2ff1366d6e94ac9ce4d38f3954c13 100644 --- a/src/Service/UWServiceInterface.php +++ b/src/Service/UWServiceInterface.php @@ -6,9 +6,9 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\node\NodeInterface; /** - * Interface UWServiceInterface + * Interface UWServiceInterface. * - * Interface that is collection of common functions used throughout custom blocks. + * Interface that is collection of common functions used in custom blocks. * * @package Drupal\uw_cfg_common\Service */ @@ -41,4 +41,122 @@ interface UWServiceInterface { * Array of variables and their values. */ public function getTeaserContent(NodeInterface $node, array $variables_to_get, string $teaser_type): array; + + /** + * A function to get or check the attached sidebar. + * + * If the type is set to check, then the function will return one + * of two things. It will either return a 0, which means that the + * attached_page_nid is not attached to any other sidebar in the + * system. Or it will return the entity_id of the sidebar (sidebar_nid) + * that it is currently attached to. + * + * For example: + * If the attached_page_nid is 3 and the sidebar_nid is 7, and + * the query finds that 3 is already attached to sidebar_nid 6, then 6 + * will be returned. + * + * If the attached_page_nid is 3 and the sidebar_nid is 7, and + * the query finds no other sidebar_nids that 3 is attached to, then 0 + * will be returned. + * + * @param int $attached_page_nid + * An integer value that represents the nid of the page to be attached to. + * @param int|null $sidebar_nid + * An integer value that represents the nid of the current sidebar. + * @param string|null $type + * A string value that represents either "get" or "check". + * + * @return int + * A value that is either 0 (no nids) or the entity_id of a sidebar. + */ + public function getOrCheckAttachedSidebar(int $attached_page_nid, int $sidebar_nid = NULL, string $type = NULL): int; + + /** + * A function to get an array of UW content types, with or without sidebar. + * + * @param bool $with_sidebar + * A boolean to state if we want content types that can have sidebars. + * + * @return array + * An array of the machine names of the UW content types. + */ + public function getUwContentTypes(bool $with_sidebar = FALSE): array; + + /** + * A function to get an array of menu. + * + * @param string $menu_name + * A string to the machine name of the menu to get. + * @param bool $count_menu_items + * A boolean on whether to count the number of menu items. + * @param bool $include_parent_in_count + * A boolean on whether to include the parent in the menu items count. + * + * @return array + * An array of the menu. + */ + public function uwGetMenu(string $menu_name = 'main', bool $count_menu_items = FALSE, bool $include_parent_in_count = FALSE): array; + + /** + * A function to setup the menu for UW display. + * + * This function will count of the number of menu items, + * and use a recursive function (uwCountMenuItems) to count + * the total number of menu items. + * + * The variable include_parent_in_count tells us if we need + * to add one to the total count of menu items. This is required + * for displaying some menus as the parent is also included + * in the displaying of the menu (i.e. the tray of the main and + * information for menus). + * + * For example, the menu structure will look like: + * Parent + * Child #1 + * Grandchild #1-1 + * Grandchild #1-2 + * Child #2 + * Child #3 + * Grandchild #3-1 + * Great grandchild #3-1-1 + * Great grandchild #3-1-2 + * Grandchild #3-2 + * Grandchild #3-3 + * Great grandchild #3-3-1 + * So it should with the recursive function it will return 11. + * If we include the parent the count will be 12. + * + * @param array $menus + * A reference to the array list of menu items. + * @param bool $include_parent_in_count + * A boolean on whether to include the parent in the menu items count. + * + * @return array + * An array of the updated menu items. + */ + public function uwSetMenuItems(array $menus, bool $include_parent_in_count = FALSE): array; + + /** + * A function to recursively count the number of menu items in the submenu. + * + * @param array $menu + * An array that contains the submenu. + * @param int &$menu_items_count + * A reference to the integer that is storing the number of menu items. + */ + public function uwCountMenuItems(array $menu, int &$menu_items_count): void; + + /** + * A function to return the month short name. + * + * @param int $month + * An integer of the month. + * + * @return mixed + * A mixed variable that will either be a string of the short + * month with a period or array of all short months. + */ + public function uwMonthNameShort(int $month = NULL); + } diff --git a/src/UwPermissions/UwPermissions.php b/src/UwPermissions/UwPermissions.php index 7c229a783fa9ca98d18a98095a8b346294912f28..05b9e4c9ddd1fb772e0cbaf509650144c16791ea 100644 --- a/src/UwPermissions/UwPermissions.php +++ b/src/UwPermissions/UwPermissions.php @@ -6,6 +6,8 @@ use Drupal\user\Entity\Role; /** * Class UwPermissions. + * + * UW Specific permissions. */ class UwPermissions { @@ -54,54 +56,135 @@ class UwPermissions { // Blog permissions. 'Blog' => [ 'Use content type' => - UwPermissions::buildRolePermissionsListContentType('uw_ct_blog'), + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_blog' + ), 'Create/edit tags' => - UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_blog_tags', ['create', 'edit']), + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_blog_tags', + ['create', 'edit'] + ), 'Delete tags' => - UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_blog_tags', ['delete']), + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_blog_tags', + ['delete'] + ), + ], + + // Catalog permissions. + 'Catalog' => [ + 'Use content type' => + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_catalog_item' + ), + 'Create/edit audience' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_audience', + ['create', 'edit'] + ), + 'Delete audience' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_audience', + ['delete'] + ), + 'Create/edit categories' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_catalog_categories', + ['create', 'edit'] + ), + 'Delete categories' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_catalog_categories', + ['delete'] + ), + 'Create/edit catalogs' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_catalogs', + ['create', 'edit'] + ), + 'Delete catalogs' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_catalogs', + ['delete'] + ), ], // Event permissions. 'Event' => [ - 'Use content type' => UwPermissions::buildRolePermissionsListContentType('uw_ct_event'), - 'Create/edit tags' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_tax_event_tags', ['create', 'edit']), - 'Delete tags' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_tax_event_tags', ['delete']), - 'Create/edit types' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_tax_event_type', ['create', 'edit']), - 'Delete types' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_tax_event_type', ['delete']), + 'Use content type' => + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_event' + ), + 'Create/edit tags' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_tax_event_tags', + ['create', 'edit'] + ), + 'Delete tags' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_tax_event_tags', + ['delete'] + ), + 'Create/edit types' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_tax_event_type', + ['create', 'edit'] + ), + 'Delete types' => + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_tax_event_type', + ['delete'] + ), ], // News permissions. 'News' => [ 'Use content type' => - UwPermissions::buildRolePermissionsListContentType('uw_ct_news_item'), + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_news_item' + ), 'Create/edit tags' => - UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_news_tags', ['create', 'edit']), + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_news_tags', + ['create', 'edit'] + ), 'Delete tags' => - UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_news_tags', ['delete']), + UwPermissions::buildRolePermissionsListTaxonomyTerm( + 'uw_vocab_news_tags', + ['delete'] + ), ], // Sidebar permissions. 'Sidebar' => [ 'Use content type' => - UwPermissions::buildRolePermissionsListContentType('uw_ct_sidebar'), + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_sidebar' + ), ], // Site footer permissions. 'Site footer' => [ 'Use content type' => - UwPermissions::buildRolePermissionsListContentType('uw_ct_site_footer'), + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_site_footer' + ), ], // Special alert permissions. 'Special alert' => [ - 'Use content type' => - UwPermissions::buildRolePermissionsListCustom('administer special alert'), + 'Administer Display' => + UwPermissions::buildRolePermissionsListCustom( + 'administer special alert' + ), ], // Web page permissions. 'Web page' => [ 'Use content type' => - UwPermissions::buildRolePermissionsListContentType('uw_ct_web_page'), + UwPermissions::buildRolePermissionsListContentType( + 'uw_ct_web_page' + ), ], ]; diff --git a/uw_cfg_common.info.yml b/uw_cfg_common.info.yml index fe7fa29c40290f871392207781ebeb3bbd0a4aae..0838923fad441a21beddb793e83bd8ae295778e3 100644 --- a/uw_cfg_common.info.yml +++ b/uw_cfg_common.info.yml @@ -3,29 +3,36 @@ description: 'Configuration for all common WCMS' type: module core_version_requirement: '^8.7.7 || ^9' dependencies: - - block_list_override - - captcha - - ckeditor - - config_views - - core_event_dispatcher - - editor - - features - - field - - field_event_dispatcher - - filter - - hcaptcha - - hook_event_dispatcher - - language - - layout_builder - - layout_builder_browser - - layout_builder_modal - - layout_builder_restrictions - - layout_builder_styles - - linkit - - media - - node - - pathauto - - preprocess_event_dispatcher - - taxonomy - - user - - views + - drupal:block_content + - drupal:block_list_override + - drupal:captcha + - drupal:ckeditor + - drupal:config_views + - drupal:core_event_dispatcher + - drupal:ctools + - drupal:editor + - drupal:features + - drupal:field + - drupal:field_event_dispatcher + - drupal:filter + - drupal:hcaptcha + - drupal:hook_event_dispatcher + - drupal:language + - drupal:layout_builder + - drupal:layout_builder_browser + - drupal:layout_builder_modal + - drupal:layout_builder_restrictions + - drupal:layout_builder_styles + - drupal:linkit + - drupal:media + - drupal:metatag + - drupal:node + - drupal:path + - drupal:pathauto + - drupal:preprocess_event_dispatcher + - drupal:realname + - drupal:taxonomy + - drupal:text + - drupal:user + - drupal:userprotect + - drupal:views diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 22a8f5e07651db13044d3237b5716b2913986253..13801df04ebedd2d3c45bb73ab8a7bd0597972ff 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -5,6 +5,7 @@ * Install, update and uninstall for Configuration of all common WCMS. */ +use Drupal\taxonomy\Entity\Term; use Drupal\uw_cfg_common\UwPermissions\UwPermissions; /** @@ -27,6 +28,37 @@ function uw_cfg_common_install() { 'Site manager', ], ], + 'Catalog' => [ + 'Use content type' => [ + 'Site manager', + 'Content author', + 'Content editor', + ], + 'Create/edit audience' => [ + 'Site manager', + 'Content author', + 'Content editor', + ], + 'Delete audience' => [ + 'Site manager', + ], + 'Create/edit categories' => [ + 'Site manager', + 'Content author', + 'Content editor', + ], + 'Delete categories' => [ + 'Site manager', + ], + 'Create/edit catalogs' => [ + 'Site manager', + 'Content author', + 'Content editor', + ], + 'Delete catalogs' => [ + 'Site manager', + ], + ], 'Event' => [ 'Use content type' => [ 'Site manager', @@ -80,10 +112,8 @@ function uw_cfg_common_install() { ], ], 'Special alert' => [ - 'Use content type' => [ + 'Administer Display' => [ 'Site manager', - 'Content author', - 'Content editor', ], ], 'Web page' => [ @@ -106,29 +136,29 @@ function uw_cfg_common_install() { 'Future undergraduate students', 'Future graduate students', ], - 'Faculty', - 'Staff', - 'Alumni', - 'Parents', - 'Donors | Friends | Supporters', - 'Employers', - 'International', - 'Media', + 'Faculty' => 'Faculty', + 'Staff' => 'Staff', + 'Alumni' => 'Alumni', + 'Parents' => 'Parents', + 'Donors | Friends | Supporters' => 'Donors | Friends | Supporters', + 'Employers' => 'Employers', + 'International' => 'International', + 'Media' => 'Media', ]; $weight = 0; foreach ($terms as $key => $term) { - if (is_array($term)) { - $parent = _uw_cfg_common_create_term($key, 'uw_vocab_audience', $weight, []); + if (is_array($term)) { + $parent = _uw_cfg_common_create_term($key, 'uw_vocab_audience', $weight, []); - foreach ($term as $child) { - _uw_cfg_common_create_term($child, 'uw_vocab_audience', $weight, [$parent]); - } - } - else { - _uw_cfg_common_create_term($term, 'uw_vocab_audience', $weight, []); - } - $weight++; + foreach ($term as $child) { + _uw_cfg_common_create_term($child, 'uw_vocab_audience', $weight, [$parent]); + } + } + else { + _uw_cfg_common_create_term($term, 'uw_vocab_audience', $weight, []); + } + $weight++; } } @@ -148,20 +178,24 @@ function uw_cfg_common_install() { * $term_id = _nodemaker_term_create('My Term', 'my_vocab', 0, [999]); * @endcode * - * @param string $term + * @param string $taxonomy_name * - Term Name. - * @param string $vocabulary + * @param string $vocab_machine_name * - System id of the vocabulary term will be added to. - * @param array $parent + * @param string|int $weight + * - Taxonomy term weight. + * @param array $parent_tid * - Array of term ids to be assigned as parent. * * @return int|null * - Returns the term id of the created term on success, null on failure. + * + * @throws \Drupal\Core\Entity\EntityStorageException */ function _uw_cfg_common_create_term($taxonomy_name, $vocab_machine_name, $weight, array $parent_tid = []) { // Create the taxonomy term. - $new_term = Drupal\taxonomy\Entity\Term::create([ + $new_term = Term::create([ 'name' => $taxonomy_name, 'vid' => $vocab_machine_name, 'parent' => $parent_tid, diff --git a/uw_cfg_common.libraries.yml b/uw_cfg_common.libraries.yml index a2b27e509e1ebb8f9bb4fda3f12de2b03f7a863d..4aabb6dc58d81af8151c19ac7dc890fdbbd09ba8 100644 --- a/uw_cfg_common.libraries.yml +++ b/uw_cfg_common.libraries.yml @@ -33,3 +33,6 @@ uw_layout_inverted_l_left: css: theme: layouts/uw-inverted-l-left/uw-layout-inverted-l-left.css: {} +uw_mathjax: + js: + https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML: { type: external, minified: true } diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index f342ed2610193c6ce29df3bf342fd8889a8fa607..9b3c02e25dd3793e760a78d1f7db376ee33af505 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -41,7 +41,7 @@ uw_global_footer.accessibility: weight: 2 uw_global_footer.media: - title: 'Media' + title: 'News' menu_name: uw-menu-global-footer url: https://uwaterloo.ca/news/ weight: 3 @@ -115,314 +115,230 @@ uw_global_social_media.linkedin: uw_content_management.content_types: title: 'Content types' menu_name: uw-menu-content-management - route_name: entity.node_type.collection - weight: 10 + url: internal:/dashboard/my_dashboard + weight: 0 uw_content_management.content_types.blog_post: title: 'Blog post' parent: uw_content_management.content_types url: internal:/node/add/uw_ct_blog - weight: 10 + weight: 0 + +uw_content_management.content_types.catalog_item.add_blog_tag: + title: 'Add blog tag' + parent: uw_content_management.content_types.blog_post + url: internal:/admin/structure/taxonomy/manage/uw_vocab_blog_tags/add + weight: 0 -uw_content_management.content_types.blog_post.blog_settings: - title: 'Blog page settings' +uw_content_management.content_types.catalog_item.list_blog_tag: + title: 'List blog tags' parent: uw_content_management.content_types.blog_post - url: internal:/node/add - weight: 10 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_blog_tags/overview + weight: 0 uw_content_management.content_types.catalog_item: title: 'Catalog item' parent: uw_content_management.content_types - url: internal:/node/add - weight: 10 - -uw_content_management.content_types.catalog_item.catalog_settings: - title: 'Catalog settings' - parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 10 + url: internal:/node/add/uw_ct_catalog_item + weight: 0 uw_content_management.content_types.catalog_item.add_catalog: title: 'Add catalog' parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 20 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_catalogs/add + weight: 0 uw_content_management.content_types.catalog_item.list_catalogs: title: 'List catalogs' parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 30 - -uw_content_management.content_types.catalog_item.merge_catalogs: - title: 'Merge catalogs' - parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 40 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_catalogs/overview + weight: 0 uw_content_management.content_types.catalog_item.add_catalog_category: title: 'Add catalog category' parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 50 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_catalog_categories/add + weight: 0 uw_content_management.content_types.catalog_item.list_catalog_categories: title: 'List catalog categories' parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 60 - -uw_content_management.content_types.catalog_item.merge_catalog_categories: - title: 'Merge catalog categories' - parent: uw_content_management.content_types.catalog_item - url: internal:/node/add - weight: 70 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_catalog_categories/overview + weight: 0 uw_content_management.content_types.contact: title: 'Contact' parent: uw_content_management.content_types - url: internal:/node/add - weight: 20 + url: internal:/node/add/uw_ct_contact + weight: 0 -uw_content_management.content_types.contact.rearrange_contacts: - title: 'Rearrange contacts' +uw_content_management.content_types.contact:.add_contact_tag: + title: 'Add contact tag' parent: uw_content_management.content_types.contact - url: internal:/node/add - weight: 10 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_contact_group/add + weight: 0 + +uw_content_management.content_types.contact.list_contact_tag: + title: 'List contact tags' + parent: uw_content_management.content_types.contact + url: internal:/admin/structure/taxonomy/manage/uw_vocab_contact_group/overview + weight: 0 uw_content_management.content_types.event: title: 'Event' parent: uw_content_management.content_types url: internal:/node/add/uw_ct_event - weight: 30 + weight: 0 + +uw_content_management.content_types.event.add_event_tag: + title: 'Add event tag' + parent: uw_content_management.content_types.event + url: internal:/admin/structure/taxonomy/manage/uw_tax_event_tags/add + weight: 0 + +uw_content_management.content_types.event.list_event_tags: + title: 'List event tags' + parent: uw_content_management.content_types.event + url: internal:/admin/structure/taxonomy/manage/uw_tax_event_tags/overview + weight: 0 + +uw_content_management.content_types.event.add_event_type: + title: 'Add event type' + parent: uw_content_management.content_types.event + url: internal:/admin/structure/taxonomy/manage/uw_tax_event_type/add + weight: 0 + +uw_content_management.content_types.event.list_event_types: + title: 'List event types' + parent: uw_content_management.content_types.event + url: internal:/admin/structure/taxonomy/manage/uw_tax_event_type/overview + weight: 0 uw_content_management.content_types.news_item: title: 'News item' parent: uw_content_management.content_types url: internal:/node/add/uw_ct_news_item - weight: 40 + weight: 0 + +uw_content_management.content_types.news_item.add_news_tag: + title: 'Add news tag' + parent: uw_content_management.content_types.news_item + url: internal:/admin/structure/taxonomy/manage/uw_vocab_news_tags/add + weight: 0 + +uw_content_management.content_types.news_item.list_news_tags: + title: 'List news tags' + parent: uw_content_management.content_types.news_item + url: internal:/admin/structure/taxonomy/manage/uw_vocab_news_tags/overview + weight: 0 + +uw_content_management.content_types.profile: + title: 'Profile' + parent: uw_content_management.content_types + url: internal:/node/add/uw_ct_profile + weight: 0 + +uw_content_management.content_types.sidebar: + title: 'Sidebar' + parent: uw_content_management.content_types + url: internal:/node/add/uw_ct_sidebar + weight: 0 + +uw_content_management.content_types.profile.add_profile_type: + title: 'Add profile type' + parent: uw_content_management.content_types.profile + url: internal:/admin/structure/taxonomy/manage/uw_vocab_profile_type/add + weight: 0 + +uw_content_management.content_types.profile.list_profile_types: + title: 'List profile types' + parent: uw_content_management.content_types.profile + url: internal:/admin/structure/taxonomy/manage/uw_vocab_profile_type/overview + weight: 0 uw_content_management.content_types.site_footer: title: 'Site footer' parent: uw_content_management.content_types url: internal:/node/add/uw_ct_site_footer - weight: 30 + weight: 0 uw_content_management.content_types.web_page: title: 'Web page' parent: uw_content_management.content_types url: internal:/node/add/uw_ct_web_page - weight: 40 + weight: 0 uw_content_management.forms: title: 'Forms' menu_name: uw-menu-content-management - url: internal:/admin/structure/webform - weight: 50 + url: internal:/dashboard/my_dashboard + weight: 0 uw_content_management.forms.form: title: 'Form' parent: uw_content_management.forms url: internal:/admin/structure/webform/add - weight: 10 + weight: 0 uw_content_management.forms.form.manage_submissions: title: 'Manage submissions' parent: uw_content_management.forms.form url: internal:/admin/structure/webform/submissions/manage - weight: 10 - -uw_content_management.reusable_content: - title: 'Reusable content' - menu_name: uw-menu-content-management - route_name: entity.node_type.collection - weight: 40 - -uw_content_management.reusable_content.blockquote: - title: 'Blockquote' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_blockquote - weight: 10 - -uw_content_management.reusable_content.call_to_action: - title: 'Call to action' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_call_to_action - weight: 15 - -uw_content_management.reusable_content.copy_text: - title: 'Copy text' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_copy_text - weight: 20 - -uw_content_management.reusable_content.expand_collapse: - title: 'Expand / Collapse' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_expand_collapse - weight: 25 - -uw_content_management.reusable_content.facebook: - title: 'Facebook' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_facebook - weight: 30 - -uw_content_management.reusable_content.facts_and_figures: - title: 'Facts and figures' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_facts_and_figures - weight: 35 - -uw_content_management.reusable_content.image: - title: 'Full width image' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_image - weight: 40 - -uw_content_management.reusable_content.instagram: - title: 'Instagram' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_instagram - weight: 45 - -uw_content_management.reusable_content.mailmain: - title: 'Mailman subscription' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_mailman - weight: 50 - -uw_content_management.reusable_content.remove_video: - title: 'Remote video' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_remote_video - weight: 55 - -uw_content_management.reusable_content.tableau: - title: 'Tableau visualization' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_tableau - weight: 60 - -uw_content_management.reusable_content.twitter: - title: 'Twitter' - parent: uw_content_management.reusable_content - url: internal:/block/add/uw_cbl_twitter - weight: 65 + weight: 0 uw_content_management.global_vocabularies: title: 'Global vocabularies' menu_name: uw-menu-content-management - route_name: entity.node_type.collection - weight: 50 + url: internal:/dashboard/my_dashboard + weight: 0 uw_content_management.global_vocabularies.audience: title: 'Audience' parent: uw_content_management.global_vocabularies - url: internal:/node/add - weight: 10 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_audience/add + weight: 0 -uw_content_management.global_vocabularies.audience.list_terms: +uw_content_management.global_vocabularies.audience.list_term: title: 'List terms' parent: uw_content_management.global_vocabularies.audience - url: internal:/node/add - weight: 10 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_audience/overview + weight: 0 -uw_content_management.global_vocabularies.audience.merge_terms: - title: 'Merge terms' +uw_content_management.global_vocabularies.audience.manage: + title: 'Manage' parent: uw_content_management.global_vocabularies.audience - url: internal:/node/add - weight: 10 - -uw_site_management.google_universal_analytics: - title: 'Google Universal Analytics' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 5 + url: internal:/admin/structure/taxonomy/manage/uw_vocab_audience + weight: 1 -uw_site_management.home_page_banner_settings: - title: 'Home page banner settings' +uw_site_management.content_access: + title: 'Content access' menu_name: uw-menu-site-management - url: internal:/node/add - weight: 10 + url: internal:/admin/content-access + weight: 0 uw_site_management.menus: title: 'Menus' menu_name: uw-menu-site-management route_name: entity.menu.collection - weight: 15 - -uw_site_management.microsoft_teams_options: - title: 'Microsoft Teams options' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 20 - -uw_site_management.open_authentication: - title: 'Open authentication' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 25 - -uw_site_management.path_review_report: - title: 'Path review report' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 30 - -uw_site_management.project_settings: - title: 'Project settings' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 35 - -uw_site_management.redirects: - title: 'Redirects' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 40 - -uw_site_management.service_ist_settings: - title: 'Service IST settings' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 45 - -uw_site_management.service_settings: - title: 'Service settings' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 50 + weight: 0 uw_site_management.shortcuts: title: 'Shortcuts' menu_name: uw-menu-site-management - url: internal:/node/add - weight: 55 - -uw_site_management.slack_options: - title: 'Slack options' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 60 - -uw_site_management.slack_mattermost_options: - title: 'Slack/Mattermost options' - menu_name: uw-menu-site-management - url: internal:/node/add - weight: 65 + url: internal:/admin/config/user-interface/shortcut + weight: 0 uw_site_management.submit_request: title: 'Submit request' menu_name: uw-menu-site-management - url: internal:/node/add - weight: 70 + url: mailto:rt-ist-wcms@rt.uwaterloo.ca + weight: 0 uw_site_management.wcms_how_to_documents: title: 'WCMS how-to documents' menu_name: uw-menu-site-management - url: internal:/node/add - weight: 75 + url: https://uwaterloo.ca/web-resources/wcms-users/training-and-support/wcms-how-documents + weight: 0 uw_main_menu.blog: title: 'Blog' diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 9edb90c3a7c3adf129209e3e724da0b6e070ddd0..0f5298ec16168079aaa2954d64dcc9ef8a482bcc 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -5,10 +5,31 @@ * Module file. */ +use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\webform\WebformInterface; use Drupal\webform\WebformSubmissionStorageInterface; +/** + * Implements hook_entity_presave(). + */ +function uw_cfg_common_entity_presave(EntityInterface $entity) { + + // Check if we are on a menu link. + if ($entity->getEntityTypeId() == 'menu_link_content') { + + // Check that we are on a Information For (audience) link. + if ($entity->menu_name->value == 'uw-menu-audience-menu') { + + // Invalid all the menu caching. + \Drupal::cache('menu')->invalidateAll(); + + // Rebuild all the menus. + \Drupal::service('plugin.manager.menu.link')->rebuild(); + } + } +} + /** * Implements hook_form_FORM_ID_alter(). * @@ -19,7 +40,7 @@ function uw_cfg_common_form_layout_builder_configure_section_alter(array &$form, unset($form['layout_builder_style']['#empty_option']); // Ensuring that the contained width is selected by default. - $form['layout_builder_style']['#default_value'] = $form['layout_builder_style']['#default_value'] ?: 'uw-contained-width'; + $form['layout_builder_style']['#default_value'] = $form['layout_builder_style']['#default_value'] ?: 'uw_lbs_contained_width'; } /** @@ -173,3 +194,85 @@ function uw_cfg_common_toolbar_alter(&$items) { } } } + +/** + * Implements hook_preprocess_node(). + */ +function uw_cfg_common_preprocess_node(&$variables) { + + // Get the current path. + $path = explode('/', \Drupal::service('path.current')->getPath()); + + // The paths to place the content moderation block on. Made this + // an array to future proof, if there are more pages later. + $paths_for_content_moderation = ['latest']; + + // ISTWCMS-4493: adding class if section has full width. + // If there is a sidebar on the node, check all sections for full width. + if (isset($variables['sidebar'])) { + + // Get the layouts from the node. + $layouts = $variables['node']->layout_builder__layout->getValue(); + + // Step through each of the layouts and check for full width. + foreach ($layouts as $layout) { + + // Get the layout settings from the section. + $settings = $layout['section']->getLayoutSettings(); + + // If the layout builder style is set to full width, then set + // the classes variable for the node and exit the loop. + if ($settings['layout_builder_styles_style'] == "uw_lbs_full_width") { + + // Add a class to the node for full width on a section. + $variables['attributes']['class'][] = 'uw-section-has-full-width'; + + // Break out of the loop to save computational time. + break; + } + } + } + + // Check if we are to add the content moderation place. + if (in_array(end($path), $paths_for_content_moderation)) { + + // Add the content moderation block. + $variables['uw_content_moderation_form'] = \Drupal::formBuilder()->getForm('Drupal\content_moderation\Form\EntityModerationForm', $variables['node']); + } + else { + + $block_manager = \Drupal::service('plugin.manager.block'); + + $plugin_block = $block_manager->createInstance('uw_cbl_content_moderation', []); + + $access_result = $plugin_block->access(\Drupal::currentUser()); + + // 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 []; + } + + $render = $plugin_block->build(); + + $variables['uw_content_moderation_form'] = $render; + } +} + +/** + * Implements hook_page_attachments(). + */ +function uw_cfg_common_page_attachments(array &$page) { + $page['#attached']['library'][] = 'uw_cfg_common/uw_mathjax'; + +} + +/** + * Implements hook_form_FORM_ID_alter(). + * + * Set the default of preview mode disabled. + */ +function uw_cfg_common_form_node_type_add_form_alter(&$form, FormStateInterface $form_state, $form_id) { + $form['submission']['preview_mode']['#default_value'] = 0; + +} diff --git a/uw_cfg_common.permissions.yml b/uw_cfg_common.permissions.yml index a9fef77cb710799722ef0647b5417aecf19d8f58..35b905c1b759a6d4b603e450698e186d428aa0eb 100644 --- a/uw_cfg_common.permissions.yml +++ b/uw_cfg_common.permissions.yml @@ -1,3 +1,7 @@ 'access content access form': title: 'Access content access form' description: 'Allows access to the content access form.' +'bypass home page protection': + title: 'Bypass home page protection' + description: 'Allows taking actions that are not normally allowed for the home page, such as unpublishing.' + restrict access: true diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index e64d3636cd0feba0b8c7cde126ee7bc4cd3ca1da..fe107ffc729639d3662c62f5f477297db57ff194 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -5,3 +5,11 @@ uw_contact_access.form: _form: '\Drupal\uw_cfg_common\Form\UwContentAccessForm' requirements: _permission: 'access content access form' +uw_content_moderation.form: + path: '/admin/uw-content-moderation/{nid}/{vid}/{status}' + defaults: + _title: 'Content moderation' + _form: '\Drupal\uw_cfg_common\Form\UwContentModerationForm' + requirements: + _custom_access: '\Drupal\uw_cfg_common\Form\UwContentModerationForm::access' + _permission: 'access content' diff --git a/uw_cfg_common.services.yml b/uw_cfg_common.services.yml index 3ebdfbfa42b4619ed8997f9a3b08a3fee9be95a7..815b941feb978d33b58ce789aa7d2f0aca980e07 100644 --- a/uw_cfg_common.services.yml +++ b/uw_cfg_common.services.yml @@ -1,7 +1,7 @@ services: uw_cfg_common.uw_service: class: Drupal\uw_cfg_common\Service\UWService - arguments: [] + arguments: ['@entity_type.manager', '@database', '@simplify_menu.menu_items'] uw_cfg_common.route_subscriber: class: Drupal\uw_cfg_common\Routing\UwNodeAccessRouteSubscriber tags: