Mercurial > hg > isophonics-drupal-site
annotate core/modules/language/language.post_update.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Post update functions for Language module. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@0 | 8 use Drupal\Core\Entity\Entity\EntityFormDisplay; |
Chris@0 | 9 |
Chris@0 | 10 /** |
Chris@0 | 11 * Add the 'include_locked' settings to the 'language_select' widget. |
Chris@0 | 12 */ |
Chris@0 | 13 function language_post_update_language_select_widget() { |
Chris@0 | 14 foreach (EntityFormDisplay::loadMultiple() as $display_form) { |
Chris@0 | 15 $content = $display_form->get('content'); |
Chris@0 | 16 $changed = FALSE; |
Chris@0 | 17 foreach (array_keys($content) as $element) { |
Chris@0 | 18 if (isset($content[$element]['type']) && $content[$element]['type'] == 'language_select') { |
Chris@0 | 19 $content[$element]['settings']['include_locked'] = TRUE; |
Chris@0 | 20 $changed = TRUE; |
Chris@0 | 21 } |
Chris@0 | 22 } |
Chris@0 | 23 if ($changed) { |
Chris@0 | 24 $display_form->set('content', $content); |
Chris@0 | 25 $display_form->save(); |
Chris@0 | 26 } |
Chris@0 | 27 } |
Chris@0 | 28 } |