Commit 47877dcb authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents dfa047da 66e52983
......@@ -5,7 +5,7 @@ id: uw_cbl_multi_type_list
block_id: uw_cbl_multi_type_list
category: uw_bc_listings
label: 'Multi-type list'
weight: -1
weight: 0
image_path: images/layout_builder_browser/multitypelist.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: ''
......@@ -5,7 +5,7 @@ id: uw_lbb_catalog_search
block_id: uw_cbl_catalog_search
category: uw_bc_searches
label: 'Catalog search'
weight: -1
weight: 0
image_path: images/layout_builder_browser/catalogsearch.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: 'Catalog search'
langcode: en
status: true
dependencies: { }
id: uw_lbb_expand_collapse
block_id: uw_cbl_expand_collapse
category: uw_bc_content
label: Expand/collapse
weight: 0
image_path: images/layout_builder_browser/expandcollapse.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: ''
......@@ -10,6 +10,7 @@ allowed_bundles:
- uw_ct_catalog_item
- uw_ct_contact
- uw_ct_event
- uw_ct_expand_collapse_group
- uw_ct_news_item
- uw_ct_opportunity
- uw_ct_profile
......
......@@ -77,6 +77,12 @@ class UwNodeAccessCheck implements AccessInterface {
return AccessResult::forbidden();
}
// The Expand/collapse group nodes should only be visible if the logged-in
// users have 'Expand/collapse group: Edit any content' permission.
if ($node && $node->bundle() == 'uw_ct_expand_collapse_group' && !$account->hasPermission('edit any uw_ct_expand_collapse_group content')) {
return AccessResult::forbidden();
}
// 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.
......
......@@ -189,6 +189,7 @@ class UWService implements UWServiceInterface {
'uw_ct_catalog_item',
'uw_ct_contact',
'uw_ct_event',
'uw_ct_expand_collapse_group',
'uw_ct_news_item',
'uw_ct_opportunity',
'uw_ct_profile',
......
......@@ -61,6 +61,10 @@ class UwNodeContent {
$content_data = $this->getEventContent($node_flags);
break;
case 'uw_ct_expand_collapse_group':
$content_data = $this->getExpandCollapseGroupContent($node_flags);
break;
case 'uw_ct_news_item':
$content_data = $this->getNewsContent($node_flags);
break;
......@@ -351,6 +355,28 @@ class UwNodeContent {
return $content_data;
}
/**
* Get the node content for e/c group content type.
*
* @param array $node_flags
* The flags for the node.
*
* @return array
* Array of content to get from the node.
*/
public function getExpandCollapseGroupContent(array $node_flags): array {
// Setup the content data array.
$content_data = $this->setupContentData($node_flags);
// Setup the actual content.
if ($node_flags['get_content']) {
$content_data['content'] = $this->addToContentData('content', '');
}
return $content_data;
}
/**
* Get the node content for news content type.
*
......
......@@ -278,8 +278,10 @@ class UwNodeFieldValue {
$banner['image'] = $this->uwService->prepareResponsiveImage($banner_para->field_uw_ban_fallback_image->entity, 'uw_ris_media');
// Vimeo embed needs to be handled same way as links.
foreach ($banner_para->field_uw_ban_vimeo_video->entity->field_media_oembed_video as $embed_video) {
$banner['video'] = $embed_video->value;
if (isset($banner_para->field_uw_ban_vimeo_video->entity->field_media_oembed_video)) {
foreach ($banner_para->field_uw_ban_vimeo_video->entity->field_media_oembed_video as $embed_video) {
$banner['video'] = $embed_video->value;
}
}
}
......
......@@ -159,6 +159,14 @@ class UwPermissions {
),
],
// Expand/Collapse.
'Expand/Collapse Group' => [
'Use content type' =>
UwPermissions::buildRolePermissionsListContentType(
'uw_ct_expand_collapse_group'
),
],
// News permissions.
'News' => [
'Use content type' =>
......
......@@ -59,6 +59,7 @@ permissions:
- 'configure editable uw_ct_catalog_item node layout overrides'
- 'configure editable uw_ct_contact node layout overrides'
- 'configure editable uw_ct_event node layout overrides'
- 'configure editable uw_ct_expand_collapse_group node layout overrides'
- 'configure editable uw_ct_news_item node layout overrides'
- 'configure editable uw_ct_opportunity node layout overrides'
- 'configure editable uw_ct_profile node layout overrides'
......@@ -101,6 +102,7 @@ permissions:
- 'enter uw_ct_catalog_item revision log entry'
- 'enter uw_ct_contact revision log entry'
- 'enter uw_ct_event revision log entry'
- 'enter uw_ct_expand_collapse_group revision log entry'
- 'enter uw_ct_news_item revision log entry'
- 'enter uw_ct_opportunity revision log entry'
- 'enter uw_ct_profile revision log entry'
......@@ -120,6 +122,9 @@ permissions:
- 'override uw_ct_event published option'
- 'override uw_ct_event revision option'
- 'override uw_ct_event sticky option'
- 'override uw_ct_expand_collapse_group published option'
- 'override uw_ct_expand_collapse_group revision option'
- 'override uw_ct_expand_collapse_group sticky option'
- 'override uw_ct_news_item promote to front page option'
- 'override uw_ct_news_item published option'
- 'override uw_ct_news_item revision option'
......
......@@ -60,6 +60,7 @@ permissions:
- 'configure editable uw_ct_catalog_item node layout overrides'
- 'configure editable uw_ct_contact node layout overrides'
- 'configure editable uw_ct_event node layout overrides'
- 'configure editable uw_ct_expand_collapse_group node layout overrides'
- 'configure editable uw_ct_news_item node layout overrides'
- 'configure editable uw_ct_opportunity node layout overrides'
- 'configure editable uw_ct_profile node layout overrides'
......@@ -88,6 +89,7 @@ permissions:
- 'enter uw_ct_catalog_item revision log entry'
- 'enter uw_ct_contact revision log entry'
- 'enter uw_ct_event revision log entry'
- 'enter uw_ct_expand_collapse_group revision log entry'
- 'enter uw_ct_news_item revision log entry'
- 'enter uw_ct_opportunity revision log entry'
- 'enter uw_ct_profile revision log entry'
......@@ -107,6 +109,9 @@ permissions:
- 'override uw_ct_event published option'
- 'override uw_ct_event revision option'
- 'override uw_ct_event sticky option'
- 'override uw_ct_expand_collapse_group published option'
- 'override uw_ct_expand_collapse_group revision option'
- 'override uw_ct_expand_collapse_group sticky option'
- 'override uw_ct_news_item promote to front page option'
- 'override uw_ct_news_item published option'
- 'override uw_ct_news_item revision option'
......
......@@ -64,6 +64,7 @@ permissions:
- 'configure editable uw_ct_catalog_item node layout overrides'
- 'configure editable uw_ct_contact node layout overrides'
- 'configure editable uw_ct_event node layout overrides'
- 'configure editable uw_ct_expand_collapse_group node layout overrides'
- 'configure editable uw_ct_news_item node layout overrides'
- 'configure editable uw_ct_opportunity node layout overrides'
- 'configure editable uw_ct_profile node layout overrides'
......@@ -107,6 +108,7 @@ permissions:
- 'enter uw_ct_catalog_item revision log entry'
- 'enter uw_ct_contact revision log entry'
- 'enter uw_ct_event revision log entry'
- 'enter uw_ct_expand_collapse_group revision log entry'
- 'enter uw_ct_news_item revision log entry'
- 'enter uw_ct_opportunity revision log entry'
- 'enter uw_ct_profile revision log entry'
......@@ -126,6 +128,9 @@ permissions:
- 'override uw_ct_event published option'
- 'override uw_ct_event revision option'
- 'override uw_ct_event sticky option'
- 'override uw_ct_expand_collapse_group published option'
- 'override uw_ct_expand_collapse_group revision option'
- 'override uw_ct_expand_collapse_group sticky option'
- 'override uw_ct_news_item promote to front page option'
- 'override uw_ct_news_item published option'
- 'override uw_ct_news_item revision option'
......
......@@ -25,7 +25,6 @@ dependencies:
- 'drupal:language'
- 'drupal:layout_builder'
- 'drupal:layout_builder_browser'
- 'drupal:layout_builder_expand_collapse'
- 'drupal:layout_builder_modal'
- 'drupal:layout_builder_restrictions'
- 'drupal:layout_builder_styles'
......
......@@ -140,6 +140,13 @@ function uw_cfg_common_install() {
'Site manager',
],
],
'Expand/Collapse Group' => [
'Use content type' => [
'Site manager',
'Content author',
'Content editor',
],
],
'News' => [
'Use content type' => [
'Site manager',
......
......@@ -226,6 +226,12 @@ uw_content_management.content_types.event.list_event_types:
url: internal:/admin/structure/taxonomy/manage/uw_tax_event_type/overview
weight: 0
uw_content_management.content_types.expand_collapse:
title: 'Expand/collapse group'
parent: uw_content_management.content_types
url: internal:/node/add/uw_ct_expand_collapse_group
weight: 0
uw_content_management.content_types.news_item:
title: 'News item'
parent: uw_content_management.content_types
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment