diff --git a/modules/dropsolid_demo_config/assets/csv/socials.csv b/modules/dropsolid_demo_config/assets/csv/socials.csv index ed9d936b923a736e312f99819fa47e5a94ac17f0..9f7c8a4314f66c46a61309e0d304d76b524c07a2 100644 --- a/modules/dropsolid_demo_config/assets/csv/socials.csv +++ b/modules/dropsolid_demo_config/assets/csv/socials.csv @@ -1,2 +1,2 @@ id,title,uuid,field_social_link_facebook,field_social_link_twitter,field_social_link_linkedin,field_social_link_instagram -1,Socials,55da64d2-ed75-4038-9df0-8ec57fb06516,https://www.facebook.com/dropsolid,https://twitter.com/dropsolid,https://www.linkedin.com/company/dropsolid,https://www.instagram.com +1,Socials,55da64d2-ed75-4038-9df0-8ec57fb06516,https://www.facebook.com/dropsolid,https://twitter.com/dropsolid,https://www.linkedin.com/company/dropsolid,https://www.instagram.com/dropsolidgent diff --git a/modules/dropsolid_demo_config/config/install/migrate_plus.migration.dropsolid_demo_config_menu_links.yml b/modules/dropsolid_demo_config/config/install/migrate_plus.migration.dropsolid_demo_config_menu_links.yml new file mode 100644 index 0000000000000000000000000000000000000000..4fce50881b22096c541fb0f0d0af2e00f9428ae1 --- /dev/null +++ b/modules/dropsolid_demo_config/config/install/migrate_plus.migration.dropsolid_demo_config_menu_links.yml @@ -0,0 +1,36 @@ +langcode: en +status: true +dependencies: { } +id: dropsolid_demo_config_menu_links +migration_group: dropsolid_demo_config_migrates +label: 'Create homepage link' +source: + constants: + node_uri_prefix: 'entity:node/' + plugin: embedded_data + data_rows: + - + id: 1 + title: 'Home' + menu_name: main + link: 'internal:/' + weight: -99 + expanded: 0 + ids: + id: + type: integer +process: + langcode: + plugin: callback + callable: rocketship_core_get_default_content_default_language + bundle: + plugin: default_value + default_value: menu_link_content + menu_name: menu_name + title: title + link/uri: link + weight: weight + expanded: expanded +destination: + plugin: 'entity:menu_link_content' +migration_dependencies: { } diff --git a/modules/dropsolid_demo_config/dropsolid_demo_config.module b/modules/dropsolid_demo_config/dropsolid_demo_config.module index 7397eefad1209cc78762e4660ab11cbee639aca3..d166c9701b9bf9b8a19cd13e459b68b8d5f77c18 100644 --- a/modules/dropsolid_demo_config/dropsolid_demo_config.module +++ b/modules/dropsolid_demo_config/dropsolid_demo_config.module @@ -14,6 +14,7 @@ function _dropsolid_demo_config_migrates() { 'dropsolid_demo_config_socials', 'dropsolid_demo_config_usp_block', 'dropsolid_demo_config_site_branding', + 'dropsolid_demo_config_menu_links', ]; } diff --git a/src/Form/AssemblerForm.php b/src/Form/AssemblerForm.php index 38c2ee30faa7c03a72353ae84145382894816aea..afda3abd8b4da121452fe1a99af0eb3b1c93bb30 100644 --- a/src/Form/AssemblerForm.php +++ b/src/Form/AssemblerForm.php @@ -8,6 +8,7 @@ use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -125,12 +126,29 @@ class AssemblerForm extends FormBase { '#tree' => FALSE, '#weight' => isset($module->info['weight']) ? $module->info['weight'] : 0, ]; + + // Add a link to the FA if available. + if (!empty($module->info['fa_link'])) { + $form[$filename . '_wrapper']['extra_info_wrapper'] = [ + '#type' => 'container', + '#attributes' => [ + 'style' => 'display:block;margin-top:5px;', + ], + ]; + + $form[$filename . '_wrapper']['extra_info_wrapper']['extra_info'] = [ + '#title' => $this->t('Functional Analysis'), + '#type' => 'link', + '#url' => Url::fromUri($module->info['fa_link'], ['attributes' => ['target' => '_blank']]), + ]; + } + // Add the module itself as the first module. $form[$filename . '_wrapper']['extra_features'][$filename] = [ '#type' => 'checkbox', - '#title' => $this->t('Core'), + '#title' => isset($module->info['name_override']) ? $module->info['name_override'] : $this->t('Core'), '#description' => $this->t($module->info['description']), - '#default_value' => (bool) $module->status, + '#default_value' => (bool) empty($module->info['prechecked']) ? $module->status : $module->info['prechecked'], // If already enabled at this point, don't allow them to uncheck it // Means it's a dependency of the profile and they can't not install // it anyway. @@ -150,7 +168,7 @@ class AssemblerForm extends FormBase { '#type' => 'checkbox', '#title' => $this->t($name), '#description' => $this->t($info->info['description']), - '#default_value' => (bool) $info->status, + '#default_value' => (bool) empty($info->info['prechecked']) ? $info->status : $info->info['prechecked'], '#disabled' => (bool) $info->status, ]; // Add states to these upgrades if defined.