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. 56
      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:
- image
- link
- panelizer
- text
third_party_settings:
panelizer:
enable: false
custom: false
allow: false
default: default
id: taxonomy_term.licenses.default
targetEntityType: taxonomy_term
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
dependencies:
module:
- lightning_core
- paragraphs
third_party_settings:
lightning_core:
description: ''
id: paragraph.license_attribution
label: 'License attribution'
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
module:
- entity_reference_revisions
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: media.image.field_image_attribution
field_name: field_image_attribution
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
module:
- link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_attribution_author
field_name: field_attribution_author
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
module:
- link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_attribution_source
field_name: field_attribution_source
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
- paragraphs.paragraphs_type.license_attribution
- taxonomy.vocabulary.licenses
module:
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: paragraph.license_attribution.field_license
field_name: field_license
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
module:
- image
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: taxonomy_term.licenses.field_license_icon
field_name: field_license_icon
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
module:
- link
- require_on_publish
third_party_settings:
require_on_publish:
require_on_publish: false
id: taxonomy_term.licenses.field_license_link
field_name: field_license_link
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:
module:
- entity_reference_revisions
- field_permissions
- media
- paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: media.field_image_attribution
field_name: field_image_attribution
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
dependencies:
module:
- field_permissions
- link
- paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_attribution_author
field_name: field_attribution_author
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
dependencies:
module:
- field_permissions
- link
- paragraphs
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_attribution_source
field_name: field_attribution_source
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
dependencies:
module:
- field_permissions
- paragraphs
- taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: paragraph.field_license
field_name: field_license
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
dependencies:
module:
- field_permissions
- file
- image
- taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: taxonomy_term.field_license_icon
field_name: field_license_icon
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
dependencies:
module:
- field_permissions
- link
- taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: taxonomy_term.field_license_link
field_name: field_license_link
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

56
entity_embed_attribution.module

@ -36,40 +36,43 @@ function entity_embed_attribution_help($route_name, RouteMatchInterface $route_m
* Add attribution form to media embed forms and view displays.
*/
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->setComponent('field_image_attribution',
[
'region' => 'content',
'settings' => [
'title' => 'Paragraph',
'title_plural' => 'Paragraphs',
'edit_mode' => 'open',
'closed_mode' => 'summary',
'autocollapse' => 'none',
'closed_mode_threshold' => 0,
'add_mode' => 'dropdown',
'form_display_mode' => 'default',
'default_paragraph_type' => '',
'features' => [
'duplicate' => 'duplicate',
'collapse_edit_all' => 'collapse_edit_all',
]
],
'type' => 'paragraphs',
])
->save();
if (!empty($form_entity)) {
$form_entity->setComponent('field_image_attribution',
[
'region' => 'content',
'settings' => [
'title' => 'Paragraph',
'title_plural' => 'Paragraphs',
'edit_mode' => 'open',
'closed_mode' => 'summary',
'autocollapse' => 'none',
'closed_mode_threshold' => 0,
'add_mode' => 'dropdown',
'form_display_mode' => 'default',
'default_paragraph_type' => '',
'features' => [
'duplicate' => 'duplicate',
'collapse_edit_all' => 'collapse_edit_all',
]
],
'type' => 'paragraphs',
])
->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->setComponent('field_image_attribution', [
if (!empty($view_entity)) {
$view_entity->setComponent('field_image_attribution', [
'type' => 'entity_reference_revisions_entity_view',
'label' => 'hidden',
'settings' => ['view_mode' => 'default', 'link' => ''],
])->save();
}
}
// Load default license terms from the module config.
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'] = [
'first' => [

Loading…
Cancel
Save