Skip to content
Snippets Groups Projects
Commit bf18c20e authored by Nick Vanpraet's avatar Nick Vanpraet
Browse files

Changes to AssemblerForm, migrate a "home" link in demo config and add correct dropsolid instagram

parent 7c4c0d56
No related branches found
Tags 8.x-1.0-beta17
No related merge requests found
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
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: { }
......@@ -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',
];
}
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment