Browse Source

Remove unnecessary dependencies

wip
Alexander O'Neill 6 years ago
parent
commit
b7f8dd1a21
  1. 11
      README.md
  2. 0
      config/install/core.entity_form_display.paragraph.license_attribution.default.yml
  3. 0
      config/install/core.entity_view_display.paragraph.license_attribution.default.yml
  4. 6
      config/install/core.entity_view_display.taxonomy_term.licenses.default.yml
  5. 4
      config/install/core.entity_view_mode.paragraph.license_attribution.yml
  6. 3
      config/install/field.field.media.image.field_image_attribution.yml
  7. 4
      config/install/field.field.paragraph.license_attribution.field_attribution_author.yml
  8. 4
      config/install/field.field.paragraph.license_attribution.field_attribution_source.yml
  9. 5
      config/install/field.field.paragraph.license_attribution.field_license.yml
  10. 4
      config/install/field.field.taxonomy_term.licenses.field_license_icon.yml
  11. 4
      config/install/field.field.taxonomy_term.licenses.field_license_link.yml
  12. 4
      config/install/field.storage.media.field_image_attribution.yml
  13. 4
      config/install/field.storage.paragraph.field_attribution_author.yml
  14. 4
      config/install/field.storage.paragraph.field_attribution_source.yml
  15. 4
      config/install/field.storage.paragraph.field_license.yml
  16. 4
      config/install/field.storage.taxonomy_term.field_license_icon.yml
  17. 4
      config/install/field.storage.taxonomy_term.field_license_link.yml
  18. 0
      config/install/paragraphs.paragraphs_type.license_attribution.yml
  19. 0
      config/install/taxonomy.vocabulary.licenses.yml
  20. 0
      config/optional
  21. 12
      entity_embed_attribution.module

11
README.md

@ -0,0 +1,11 @@
# Installation
Install as you normally would. This module creates the following entity types:
* Taxonomy vocabulary
* Licences (licenses) - Includes License Link and License Icon fields
* Paragraphs type
* License Attribution (license_attribution)
# Use

0
config/optional/core.entity_form_display.paragraph.license_attribution.default.yml → config/install/core.entity_form_display.paragraph.license_attribution.default.yml

0
config/optional/core.entity_view_display.paragraph.license_attribution.default.yml → config/install/core.entity_view_display.paragraph.license_attribution.default.yml

6
config/optional/core.entity_view_display.taxonomy_term.licenses.default.yml → config/install/core.entity_view_display.taxonomy_term.licenses.default.yml

@ -8,14 +8,8 @@ dependencies:
module: module:
- image - image
- link - link
- panelizer
- text - text
third_party_settings: third_party_settings:
panelizer:
enable: false
custom: false
allow: false
default: default
id: taxonomy_term.licenses.default id: taxonomy_term.licenses.default
targetEntityType: taxonomy_term targetEntityType: taxonomy_term
bundle: licenses bundle: licenses

4
config/optional/core.entity_view_mode.paragraph.license_attribution.yml → config/install/core.entity_view_mode.paragraph.license_attribution.yml

@ -2,11 +2,7 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- lightning_core
- paragraphs - paragraphs
third_party_settings:
lightning_core:
description: ''
id: paragraph.license_attribution id: paragraph.license_attribution
label: 'License attribution' label: 'License attribution'
targetEntityType: paragraph targetEntityType: paragraph

3
config/optional/field.field.media.image.field_image_attribution.yml → config/install/field.field.media.image.field_image_attribution.yml

@ -7,10 +7,7 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- entity_reference_revisions - entity_reference_revisions
- require_on_publish
third_party_settings: third_party_settings:
require_on_publish:
require_on_publish: false
id: media.image.field_image_attribution id: media.image.field_image_attribution
field_name: field_image_attribution field_name: field_image_attribution
entity_type: media entity_type: media

4
config/optional/field.field.paragraph.license_attribution.field_attribution_author.yml → config/install/field.field.paragraph.license_attribution.field_attribution_author.yml

@ -6,10 +6,6 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- link - link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_attribution_author id: paragraph.license_attribution.field_attribution_author
field_name: field_attribution_author field_name: field_attribution_author
entity_type: paragraph entity_type: paragraph

4
config/optional/field.field.paragraph.license_attribution.field_attribution_source.yml → config/install/field.field.paragraph.license_attribution.field_attribution_source.yml

@ -6,10 +6,6 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- link - link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_attribution_source id: paragraph.license_attribution.field_attribution_source
field_name: field_attribution_source field_name: field_attribution_source
entity_type: paragraph entity_type: paragraph

5
config/optional/field.field.paragraph.license_attribution.field_license.yml → config/install/field.field.paragraph.license_attribution.field_license.yml

@ -5,11 +5,6 @@ dependencies:
- field.storage.paragraph.field_license - field.storage.paragraph.field_license
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
- taxonomy.vocabulary.licenses - taxonomy.vocabulary.licenses
module:
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_license id: paragraph.license_attribution.field_license
field_name: field_license field_name: field_license
entity_type: paragraph entity_type: paragraph

4
config/optional/field.field.taxonomy_term.licenses.field_license_icon.yml → config/install/field.field.taxonomy_term.licenses.field_license_icon.yml

@ -6,10 +6,6 @@ dependencies:
- taxonomy.vocabulary.licenses - taxonomy.vocabulary.licenses
module: module:
- image - image
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: taxonomy_term.licenses.field_license_icon id: taxonomy_term.licenses.field_license_icon
field_name: field_license_icon field_name: field_license_icon
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.field.taxonomy_term.licenses.field_license_link.yml → config/install/field.field.taxonomy_term.licenses.field_license_link.yml

@ -6,10 +6,6 @@ dependencies:
- taxonomy.vocabulary.licenses - taxonomy.vocabulary.licenses
module: module:
- link - link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: taxonomy_term.licenses.field_license_link id: taxonomy_term.licenses.field_license_link
field_name: field_license_link field_name: field_license_link
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.storage.media.field_image_attribution.yml → config/install/field.storage.media.field_image_attribution.yml

@ -3,12 +3,8 @@ status: true
dependencies: dependencies:
module: module:
- entity_reference_revisions - entity_reference_revisions
- field_permissions
- media - media
- paragraphs - paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: media.field_image_attribution id: media.field_image_attribution
field_name: field_image_attribution field_name: field_image_attribution
entity_type: media entity_type: media

4
config/optional/field.storage.paragraph.field_attribution_author.yml → config/install/field.storage.paragraph.field_attribution_author.yml

@ -2,12 +2,8 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- field_permissions
- link - link
- paragraphs - paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_attribution_author id: paragraph.field_attribution_author
field_name: field_attribution_author field_name: field_attribution_author
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.paragraph.field_attribution_source.yml → config/install/field.storage.paragraph.field_attribution_source.yml

@ -2,12 +2,8 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- field_permissions
- link - link
- paragraphs - paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_attribution_source id: paragraph.field_attribution_source
field_name: field_attribution_source field_name: field_attribution_source
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.paragraph.field_license.yml → config/install/field.storage.paragraph.field_license.yml

@ -2,12 +2,8 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- field_permissions
- paragraphs - paragraphs
- taxonomy - taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_license id: paragraph.field_license
field_name: field_license field_name: field_license
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.taxonomy_term.field_license_icon.yml → config/install/field.storage.taxonomy_term.field_license_icon.yml

@ -2,13 +2,9 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- field_permissions
- file - file
- image - image
- taxonomy - taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: taxonomy_term.field_license_icon id: taxonomy_term.field_license_icon
field_name: field_license_icon field_name: field_license_icon
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.storage.taxonomy_term.field_license_link.yml → config/install/field.storage.taxonomy_term.field_license_link.yml

@ -2,12 +2,8 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- field_permissions
- link - link
- taxonomy - taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: taxonomy_term.field_license_link id: taxonomy_term.field_license_link
field_name: field_license_link field_name: field_license_link
entity_type: taxonomy_term entity_type: taxonomy_term

0
config/optional/paragraphs.paragraphs_type.license_attribution.yml → config/install/paragraphs.paragraphs_type.license_attribution.yml

0
config/optional/taxonomy.vocabulary.licenses.yml → config/install/taxonomy.vocabulary.licenses.yml

0
config/optional/core.entity_form_display.taxonomy_term.licenses.default.yml → config/optional

12
entity_embed_attribution.module

@ -36,8 +36,10 @@ function entity_embed_attribution_help($route_name, RouteMatchInterface $route_m
* Add attribution form to media embed forms and view displays. * Add attribution form to media embed forms and view displays.
*/ */
function entity_embed_attribution_modules_installed($modules) { function entity_embed_attribution_modules_installed($modules) {
foreach (['media_browser', 'default'] as $form_variant) {
foreach (['default', 'media_browser'] as $form_variant) {
$form_entity = EntityFormDisplay::load("media.image.$form_variant"); $form_entity = EntityFormDisplay::load("media.image.$form_variant");
if (!empty($form_entity)) {
$form_entity->setComponent('field_image_attribution', $form_entity->setComponent('field_image_attribution',
[ [
'region' => 'content', 'region' => 'content',
@ -60,16 +62,17 @@ function entity_embed_attribution_modules_installed($modules) {
]) ])
->save(); ->save();
} }
}
foreach (['embedded', 'default'] as $entity_view_variant) { foreach (['default', 'embedded'] as $entity_view_variant) {
$view_entity = EntityViewDisplay::load("media.image.$entity_view_variant"); $view_entity = EntityViewDisplay::load("media.image.$entity_view_variant");
if (!empty($view_entity)) {
$view_entity->setComponent('field_image_attribution', [ $view_entity->setComponent('field_image_attribution', [
'type' => 'entity_reference_revisions_entity_view', 'type' => 'entity_reference_revisions_entity_view',
'label' => 'hidden', 'label' => 'hidden',
'settings' => ['view_mode' => 'default', 'link' => ''], 'settings' => ['view_mode' => 'default', 'link' => ''],
])->save(); ])->save();
} }
}
// Load default license terms from the module config. // Load default license terms from the module config.
entity_embed_attribution_load_default_licenses(); entity_embed_attribution_load_default_licenses();
} }
@ -118,7 +121,6 @@ function entity_embed_attribution_preprocess_entity_embed_container(&$variables)
]; ];
} }
// $attribution_string = \Drupal::render($attribution_text);
$variables['children'] = [ $variables['children'] = [
'first' => [ 'first' => [

Loading…
Cancel
Save