-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into BCELN24MIG-193
- Loading branch information
Showing
17 changed files
with
1,007 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
theme_overrides: | ||
version: VERSION | ||
css: | ||
theme: | ||
scss/styles.scss: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* bcelndora.module | ||
*/ | ||
|
||
use Drupal\scss_compiler\ScssCompilerAlterStorage; | ||
use Symfony\Component\Routing\Generator\UrlGenerator; | ||
|
||
/** | ||
* Implements hook_theme_suggestions_alter(). | ||
*/ | ||
function bcelndora_theme_suggestions_alter(array &$suggestions, array $variables, $hook) { | ||
// Add a views template suggestion for the taxonomy term 'person' vocab. | ||
if (in_array($hook, ['views_view'])) { | ||
$parameters = \Drupal::routeMatch()->getParameters()->all(); | ||
if (isset($parameters['taxonomy_term'])) { | ||
$term = $parameters['taxonomy_term']; | ||
$vid = $term->bundle(); | ||
$vocabulary = \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->load($vid); | ||
if ($vocabulary->getOriginalId() === "person") { | ||
$suggestions[] = $hook . '__' . 'taxonomy_term__person'; | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Implements hook_theme(). | ||
*/ | ||
function bcelndora_theme($existing, $type, $theme, $path) { | ||
return [ | ||
'views_view__taxonomy_term__person' => [ | ||
'template' => 'views-view--taxonomy-term--person', | ||
'base hook' => 'views_view', | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* Implements hook_scss_compiler_import_paths_alter(). | ||
*/ | ||
function bcelndora_scss_compiler_import_paths_alter(array &$additional_import_paths) { | ||
$theme_list = \Drupal::service('extension.list.theme'); | ||
$file_system = \Drupal::service('file_system'); | ||
$additional_import_paths[] = $file_system->realpath($theme_list->getPath('dgi_i8_base')) . "/scss/"; | ||
} | ||
|
||
/** | ||
* Implements hook_scss_compiler_variables_alter(). | ||
*/ | ||
function bcelndora_scss_compiler_variables_alter(ScssCompilerAlterStorage $storage) { | ||
if (function_exists('dgi_i8_base_scss_compiler_variables_alter')) { | ||
dgi_i8_base_scss_compiler_variables_alter($storage); | ||
} | ||
|
||
$theme_list = \Drupal::service('extension.list.theme'); | ||
$theme_path = $theme_list->getPath('dgi_i8_base'); | ||
$module_list = \Drupal::service('extension.list.module'); | ||
$module_path = $module_list->getPath('bcelndora'); | ||
|
||
/** @var \Drupal\scss_compiler\ScssCompilerInterface $scss_compiler */ | ||
$scss_compiler = \Drupal::service('scss_compiler'); | ||
$upstream = $storage->getByFile($scss_compiler->replaceTokens('@dgi_i8_base/scss/style.scss')); | ||
|
||
$to_set = array_merge( | ||
$upstream, | ||
[ | ||
'theme-path' => UrlGenerator::getRelativePath("/{$module_path}/", "/{$theme_path}"), | ||
], | ||
); | ||
|
||
$storage->setByFile($to_set, '@bcelndora/scss/styles.scss'); | ||
} | ||
|
||
/** | ||
* Implements hook_page_attachments(). | ||
* | ||
* Attach AUC specific base theme overrides via the module library. | ||
*/ | ||
function bcelndora_page_attachments(array &$page) { | ||
if (\Drupal::theme()->getActiveTheme()->getName() === "dgi_i8_base") { | ||
$page['#attached']['library'][] = 'bcelndora/theme_overrides'; | ||
} | ||
} | ||
|
||
/** | ||
* Implements hook_library_info_alter(). | ||
* | ||
* Unset the theme's 'framework' library CSS, as this module provides its own | ||
* via this module's 'hook_page_attachments' implementation. | ||
*/ | ||
function bcelndora_library_info_alter(&$libraries, $extension) { | ||
if ($extension == 'dgi_i8_base' && isset($libraries['framework']['css']['theme']['scss/style.scss'])) { | ||
unset($libraries['framework']['css']['theme']['scss/style.scss']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
id: bceln_ccl_4_0_terms | ||
label: 'BCELNDora Creative Commons Licenses 4.0 terms' | ||
migration_group: islandora | ||
migration_tags: | ||
- dgi_taxonomies | ||
source: | ||
plugin: embedded_data | ||
track_changes: true | ||
data_rows: | ||
- name: 'Public Domain Mark 1.0 Universal' | ||
vid: 'creative_commons_licenses_4_0' | ||
url: 'https://creativecommons.org/publicdomain/mark/1.0/' | ||
- name: 'CC0 1.0 Universal' | ||
vid: 'creative_commons_licenses_4_0' | ||
url: 'https://creativecommons.org/publicdomain/zero/1.0/' | ||
ids: | ||
name: | ||
type: string | ||
process: | ||
tid: | ||
- plugin: entity_lookup | ||
source: name | ||
entity_type: taxonomy_term | ||
value_key: name | ||
bundle_key: vid | ||
bundle: creative_commons_licenses_4_0 | ||
- plugin: skip_on_empty | ||
method: process | ||
name: name | ||
vid: vid | ||
field_url: url | ||
destination: | ||
plugin: 'entity:taxonomy_term' | ||
default_bundle: creative_commons_licenses_4_0 | ||
migration_dependencies: | ||
required: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
id: bceln_stub_terms_institution | ||
label: Create stub institution terms. | ||
migration_group: foxml_to_dgis | ||
source: | ||
plugin: embedded_data | ||
data_rows: [] | ||
ids: | ||
institution: | ||
type: string | ||
dsf_misc: | ||
type: &type entity:taxonomy_term | ||
bundle: &bundle institution | ||
destination: | ||
plugin: *type | ||
default_bundle: *bundle | ||
# XXX: We're not really dealing with translations here. To do so, seems like | ||
# you would need separate migrations. | ||
#translations: true | ||
validate: &validate false | ||
overwrite_properties: [] | ||
process: | ||
name: | ||
- plugin: get | ||
source: institution | ||
|
||
dependencies: | ||
enforced: | ||
module: | ||
- dgi_migrate | ||
- dgi_migrate_foxml_standard_mods |
Oops, something went wrong.