Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions az_quickstart.install
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,6 @@ function az_quickstart_install() {
]);
$shortcut->save();

// Apply install-time defaults programmatically for new builds only.
//
// These values intentionally remain out of install config defaults so they
// are not applied by configuration import on existing sites during updates.
$config_storage = \Drupal::service('config.storage');
$config_factory = \Drupal::configFactory();

// Enable AZ Navbar by default on fresh installs.
if ($config_storage->exists('az_barrio.settings')) {
$config_factory
->getEditable('az_barrio.settings')
->set('az_navbar', TRUE)
->save();
}

// Set Main navigation block depth to 3 levels on fresh installs.
if ($config_storage->exists('block.block.az_barrio_main_menu')) {
$config_factory
->getEditable('block.block.az_barrio_main_menu')
->set('settings.depth', 3)
->save();
}

// Install additional modules if site is running on Pantheon (or not).
if (defined('PANTHEON_ENVIRONMENT')) {
// Modules to install only on Pantheon.
Expand Down
21 changes: 21 additions & 0 deletions az_quickstart.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,24 @@ function az_quickstart_post_update_remove_block_content_permissions_from_roles(&
return $update;
});
}

/**
* Enables AZ Navbar.
*/
function az_quickstart_post_update_enable_az_navbar(&$sandbox) {
$updated = FALSE;
$config_storage = \Drupal::service('config.storage');
$config_factory = \Drupal::configFactory();

if ($config_storage->exists('az_barrio.settings')) {
$theme_settings = $config_factory->getEditable('az_barrio.settings');
if ($theme_settings->get('az_navbar') !== TRUE) {
$theme_settings->set('az_navbar', TRUE)->save();
$updated = TRUE;
}
}

if ($updated) {
\Drupal::logger('az_quickstart')->notice('Enabled AZ Navbar during post update.');
}
}
2 changes: 1 addition & 1 deletion config/install/block.block.az_barrio_main_menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ settings:
label_display: '0'
provider: system
level: 1
depth: 2
depth: 3
expand_all_items: true
visibility: { }
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ sticky_footer: true
az_barrio_logo_svg_inline: false
az_barrio_footer_logo_svg_inline: false
az_remove_sidebar_menu_mobile: true
az_navbar: false
az_navbar: true
primary_logo_alt_text: '[site:name] | Home'
primary_logo_title_text: '[site:name] | Home'
footer_logo_link_destination: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ az_barrio.settings:
az_navbar:
type: boolean
label: 'Enable AZ Navbar'
deprecated: 'The "az_navbar" config schema is deprecated in az_quickstart:3.4.0 and is removed from az_quickstart:3.5.0. AZ Navbar is now enabled by default. See https://quickstart.arizona.edu/site-admin/managing-menus/main-navigation'
primary_logo_alt_text:
type: label
label: 'Primary logo alt text'
Expand Down
2 changes: 1 addition & 1 deletion themes/custom/az_barrio/theme-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function az_barrio_form_system_theme_settings_alter(&$form, FormStateInterface $
'#type' => 'checkbox',
'#prefix' => "<span class='form-item__label'>" . t('AZ Navbar') . "</span>",
'#title' => t('Enable AZ Navbar'),
'#description' => t('Adds the `navbar-az` class to the main navigation bar, providing additional styling and support for a third level of navigation. DEPRECATION WARNING: The option to disable AZ Navbar will be removed in a future release.'),
'#description' => t('Adds the `navbar-az` class to the main navigation bar, providing additional styling and support for a third level of navigation. DEPRECATION WARNING: The option to not use this setting is now deprecated with Quickstart 3.4 and will be removed from Quickstart 3.5. See https://quickstart.arizona.edu/site-admin/managing-menus/main-navigation'),
'#default_value' => \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getSetting('az_navbar'),
'#wrapper_attributes' => ['class' => ['field-multiple-table']],
Comment thread
djcelaya marked this conversation as resolved.
],
Expand Down
Loading