|
|
@ -152,7 +152,7 @@ function media_attribution_preprocess_entity_embed_container(&$variables) { |
|
|
|
$variables['children'] = [ |
|
|
|
$variables['children'] = [ |
|
|
|
'first' => [ |
|
|
|
'first' => [ |
|
|
|
'#type' => 'markup', |
|
|
|
'#type' => 'markup', |
|
|
|
'#markup' => render($variables['children']) |
|
|
|
'#markup' => \Drupal::service('renderer')->render($variables['children']) |
|
|
|
], |
|
|
|
], |
|
|
|
$attribution_text |
|
|
|
$attribution_text |
|
|
|
]; |
|
|
|
]; |
|
|
@ -162,12 +162,12 @@ function media_attribution_preprocess_entity_embed_container(&$variables) { |
|
|
|
* Read the list of pre-defined Creative Commons media_attribution_licenses and create corresponding taxonomy terms. |
|
|
|
* Read the list of pre-defined Creative Commons media_attribution_licenses and create corresponding taxonomy terms. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function media_attribution_load_default_licenses() { |
|
|
|
function media_attribution_load_default_licenses() { |
|
|
|
$file_path = drupal_get_path('module', 'media_attribution') . '/media_attribution.default.licenses.yml'; |
|
|
|
$file_path = \Drupal::service('extension.list.module')->getPath('media_attribution') . '/media_attribution.default.licenses.yml'; |
|
|
|
$file_contents = file_get_contents($file_path); |
|
|
|
$file_contents = file_get_contents($file_path); |
|
|
|
$license_data = Yaml::decode($file_contents); |
|
|
|
$license_data = Yaml::decode($file_contents); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($license_data as $license_item) { |
|
|
|
foreach ($license_data as $license_item) { |
|
|
|
$icon_file_path = drupal_get_path('module', 'media_attribution') . "/" . $license_item['icon_file']; |
|
|
|
$icon_file_path = \Drupal::service('extension.list.module')->getPath('media_attribution') . "/" . $license_item['icon_file']; |
|
|
|
LicenseLoader::createLicenseTerm($license_item['title'],$license_item['short_label'], $icon_file_path, $license_item['url']); |
|
|
|
LicenseLoader::createLicenseTerm($license_item['title'],$license_item['short_label'], $icon_file_path, $license_item['url']); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|