Results
19.09.2020
cforge 2.0.x-dev ::
src/Plugin/CsvParser/Users.php
'address.administrative_area' => t('Region/Province'), // 'address.postal_code', we have no way to force these to be valid. 'address.country_code' => t('2 digit country code (default is @default)', ['@default' => \Drupal::config('system.date')->get('country.default')]), 'show_phone' => t('0 or 1 to reveal phone number(s) to other members'), 'show_address' => t('0 or 1 to reveal address to other members'), 'show_email' => t('0 or 1 to reveal definitive email to other members'), // 'grossincome' => t('gross income (instead of transaction import)'), // 'balance' => t('current balance (instead of transaction import)') ];
19.09.2020
cforge 2.0.x-dev ::
src/Setup.php
$this->extensionDiscovery = new ExtensionDiscovery(\Drupal::root()); $this->countryManager = $country_manager; $this->country = $this->config('system.date')->get('country.default'); } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) {
$country_code = $form_state->getValue('site_default_country') ?? $this->config('system.date')->get('country.default'); self::setDefaultCountry($country_code); // Set up the currency by deleting the others. if ($c = Currency::load('veur')) { $c->delete(); }
$field->set('settings', $settings) ->save(); \Drupal::configFactory()->getEditable('system.date')->set('country.default', $country_code)->save(); foreach (\Drupal::entityTypeManager()->getStorage('user')->loadMultiple() as $user) { if ($user->isAnonymous()) continue; $user->address->country_code = $country_code; $user->save(); } }
19.09.2020
cforge 2.0.x-dev ::
modules/cforge_address/cforge_address.install
function cforge_address_install() { $default_country = \Drupal::Config('system.date') ->get('country.default'); FieldConfig::load('user.user.address') ->setSetting('available_countries', [$default_country]) ->save(); $hoods = \Drupal::database()->select('user__address', 'a') ->fields('a', ['address_dependent_locality'])
19.09.2020
cforge 2.0.x-dev ::
modules/cforge_import/src/Plugin/CsvParser/Users.php
parent::__construct($configuration, $plugin_id, $plugin_definition, $logger_channel); $this->siteSettings = $config_factory->get('system_site'); $this->defaultCountryCode = $config_factory->get('system.date')->get('country.default'); $this->roles = Role::loadMultiple(); } /** * {@inheritDoc} */
24.05.2020
commerce_currency_resolver 8.x-1.53 ::
src/CurrencyHelper.php
// environment, use default country from Drupal. if (empty($country)) { $country = $this->configFactory->get('system.date')->get('country.default'); } return $country; } /**
24.05.2020
commerce_currency_resolver 8.x-1.53 ::
commerce_currency_resolver.install
if (!\Drupal::isConfigSyncing()) { // Get default country and their currency. $default_country = \Drupal::config('system.date')->get('country.default'); $default_country = $default_country ?: 'US'; $country_repository = new CountryRepository(); $country = $country_repository->get($default_country); $currency_code = $country->getCurrencyCode(); // Set initial default currency by default country.
29.10.2020
commerce_kickstart 3.x-dev ::
commerce_kickstart.install
// Import a currency to speed up initial store setup. // If no default country is set, import the US Dollar, since it's common. $default_country = \Drupal::config('system.date')->get('country.default'); $default_country = $default_country ?: 'US'; $currency_importer = \Drupal::service('commerce_price.currency_importer'); $currency_importer->importByCountry($default_country); $commerce_kickstart_install_demo = \Drupal::state() ->get('commerce_kickstart.install_demo', FALSE);
12.02.2022
commerce_pickup 1.0.0-beta2 ::
commerce_pickup.module
if (empty($address['address']['#default_value']['country_code']) && ($country_code = \Drupal::config('system.date')->get('country.default')) ) { $countries = $profile ->pickup_address ->getFieldDefinition() ->getSettings()['available_countries']; if (empty($countries) || isset($countries[$country_code])) {
29.08.2020
config_overlay 8.x-1.0-alpha4 ::
tests/src/Functional/Integration/ConfigSplitTest.php
$this->assertSame( 'Australia', $this->config('system.date')->get('country.default'), ); $menu = $this->entityTypeManager->getStorage('menu')->load('admin'); $this->assertInstanceof(MenuInterface::class, $menu); $this->assertSame('Administration EDITED', $menu->label()); }
29.08.2020
config_overlay 8.x-1.0-alpha4 ::
tests/src/Functional/Integration/ConfigIgnoreTest.php
// detected. $this->config('system.date') ->set('country.default', 'Australia') ->save(); $this->assertConfigStorageChanges(); // Make sure that importing the configuration does not revert the change. $extension = $this->serializer->getFileExtension(); $exportedConfiguration = $this->readConfigFile("$this->configSyncDirectory/system.date.$extension");
$this->assertSame( 'Australia', $this->config('system.date')->get('country.default'), ); // Change the admin menu and make sure that no change is detected. $menuStorage = $this->entityTypeManager->getStorage('menu'); $menu = $menuStorage->load('admin'); $this->assertInstanceof(MenuInterface::class, $menu);
24.07.2020
currency 8.x-3.3 ::
src/LocaleResolver.php
// Try the site's default country code. if (!$currency_locale) { $country_code = $this->configFactory->get('system.date')->get('country.default'); if ($country_code) { $currency_locale = $this->currencyLocaleStorage->load($language_code . '_' . $country_code); } }
24.07.2020
currency 8.x-3.3 ::
tests/src/Unit/LocaleResolverTest.php
$config->expects($this->any()) ->method('get') ->with('country.default') ->willReturn($site_default_country); $this->configFactory->expects($this->once()) ->method('get') ->with('system.date') ->willReturn($config);
$config->expects($this->any()) ->method('get') ->with('country.default') ->willReturn(NULL); $this->configFactory->expects($this->once()) ->method('get') ->with('system.date') ->willReturn($config);
$config->expects($this->any()) ->method('get') ->with('country.default') ->willReturn(NULL); $this->configFactory->expects($this->once()) ->method('get') ->with('system.date') ->willReturn($config);
03.02.2020
datalayer 8.x-1.x-dev ::
tests/src/Kernel/DataLayerKernelTest.php
[ 'drupalLanguage' => Language::$defaultValues['id'], 'drupalCountry' => $this->config('system.date')->get('country.default'), 'siteName' => $this->config('system.site')->get('name'), ], _datalayer_defaults() ); }
03.02.2020
datalayer 8.x-1.x-dev ::
datalayer.module
return [ $datalayer_settings->get('drupal_language') => $language->getId(), $datalayer_settings->get('drupal_country') => $site_config->get('country.default'), $datalayer_settings->get('site_name') => $site_name->get('name'), ]; } /** * Agnosticly get the current menu object.
23.06.2020
dropsolid_rocketship_profile 8.x-2.x-dev ::
src/Form/RocketshipSiteConfigureForm.php
'#title' => $this->t('Default country'), '#empty_value' => '', '#default_value' => $this->config('system.date')->get('country.default'), '#options' => $countries, '#description' => $this->t('Select the default country for the site.'), '#weight' => 0, ]; $form['regional_settings']['date_default_timezone'] = [ '#type' => 'select',
$this->config('system.date') ->set('timezone.default', (string) $form_state->getValue('date_default_timezone')) ->set('country.default', (string) $form_state->getValue('site_default_country')) ->save(TRUE); $account_values = $form_state->getValue('account'); // Enable update.module if this option was selected. $update_status_module = $form_state->getValue('enable_update_status_module');
23.06.2020
dropsolid_rocketship_profile 8.x-2.x-dev ::
dropsolid_rocketship_profile.install
\Drupal::configFactory() ->getEditable('system.date') ->set('country.default', 'BE') ->set('first_day', 1) ->set('timezone.default', 'Europe/Brussels') ->set('timezone.user.configurable', FALSE) ->set('timezone.user.warn', FALSE) ->set('timezone.user.default', 0) ->save();
17.10.2020
farm 2.x-dev ::
modules/core/settings/src/Form/FarmSettingsFarmInfoForm.php
'#title' => $this->t('Default country'), '#empty_value' => '', '#default_value' => $system_date->get('country.default'), '#options' => $countries, '#attributes' => ['class' => ['country-detect']], ]; // Get list of timezones. $timezones = system_time_zones();
$this->configFactory->getEditable('system.date') ->set('timezone.default', $default_timezone) ->set('country.default', $default_country) ->save(); // Display message from parent submitForm. parent::submitForm($form, $form_state); }
22.10.2019
global_gateway 8.x-1.x-dev ::
src/Plugin/RegionNegotiation/RegionNegotiationDefault.php
*/ public function getRegionCode(Request $request = NULL) { $default = \Drupal::config('system.date')->get('country.default'); $code = $this->get('region_code'); return $code ?: $default; } /**
30.01.2020
gmap_store_locator 8.x-1.4 ::
src/Form/StoreLocatorForm.php
*/ public function buildForm(array $form, FormStateInterface $form_state) { $country_code = $this->config('system.date')->get('country.default'); $form = parent::buildForm($form, $form_state); $form['finder'] = [ '#type' => 'button', '#value' => $this->t('Find Lat/Long'), '#weight' => 90, '#ajax' => [
09.07.2020
murmurations 1.0.0-alpha1 ::
src/Plugin/Murmurations/PluginBase.php
// NB from Drupal 10.3 this value might be NULL if ($country = $this->configFactory->get('system.date')->get('country.default')) { $fields['country'] = $country; } return $fields; } /**