Advertisement
no_angel

Untitled

Apr 2nd, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. 192-168-1-5:drupal8 admin$ git remote
  2. origin
  3. 192-168-1-5:drupal8 admin$ git fetch origin
  4. 192-168-1-5:drupal8 admin$
  5. 192-168-1-5:drupal8 admin$
  6. 192-168-1-5:drupal8 admin$ git status
  7. # On branch 8.x
  8. nothing to commit, working directory clean
  9. 192-168-1-5:drupal8 admin$
  10. 192-168-1-5:drupal8 admin$
  11. 192-168-1-5:drupal8 admin$ git merge origin
  12. Already up-to-date.
  13. 192-168-1-5:drupal8 admin$
  14. 192-168-1-5:drupal8 admin$ git checkout -b 1945226-menu-language-selector-b
  15. Switched to a new branch '1945226-menu-language-selector-b'
  16. 192-168-1-5:drupal8 admin$ pwd
  17. /Users/admin/drupal8
  18. 192-168-1-5:drupal8 admin$ curl -O http://drupal.org/files/drupal-1945226-Add-language-selector-on-menus-3.patch
  19. % Total % Received % Xferd Average Speed Time Time Time Current
  20. Dload Upload Total Spent Left Speed
  21. 100 3801 100 3801 0 0 3177 0 0:00:01 0:00:01 --:--:-- 8191
  22. 192-168-1-5:drupal8 admin$ git apply drupal-1945226-Add-language-selector-on-menus-3.patch
  23. 192-168-1-5:drupal8 admin$
  24. 192-168-1-5:drupal8 admin$ git status
  25. # On branch 1945226-menu-language-selector-b
  26. # Changes not staged for commit:
  27. # (use "git add <file>..." to update what will be committed)
  28. # (use "git checkout -- <file>..." to discard changes in working directory)
  29. #
  30. # modified: core/modules/menu/lib/Drupal/menu/MenuFormController.php
  31. #
  32. # Untracked files:
  33. # (use "git add <file>..." to include in what will be committed)
  34. #
  35. # sites/default/files/
  36. # sites/default/settings.php
  37. no changes added to commit (use "git add" and/or "git commit -a")
  38. 192-168-1-5:drupal8 admin$ git diff
  39. diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
  40. index ff42a20..e229451 100644
  41. --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php
  42. +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
  43. @@ -63,6 +63,31 @@ public function form(array $form, array &$form_state, EntityInterface $menu) {
  44. $form['links'] = menu_overview_form($form['links'], $form_state);
  45. }
  46.  
  47. + // $form['langcode'] is not wrapped in an if (module_exists('language'))
  48. + // check because the language_select form element works also without the
  49. + // language module being installed.
  50. + // http://drupal.org/node/1749954 documents the new element.
  51. + $form['langcode'] = array(
  52. + '#type' => 'language_select',
  53. + '#title' => t('Menu language'),
  54. + '#languages' => LANGUAGE_ALL,
  55. + '#default_value' => $menu->langcode,
  56. + );
  57. + if (module_exists('language')) {
  58. + $form['default_menu_items_language'] = array(
  59. + '#type' => 'details',
  60. + '#title' => t('Menu items language'),
  61. + );
  62. + $form['default_menu_items_language']['default_language'] = array(
  63. + '#type' => 'language_configuration',
  64. + '#entity_information' => array(
  65. + 'entity_type' => 'menu_item',
  66. + 'bundle' => $menu->id(),
  67. + ),
  68. + '#default_value' => language_get_default_configuration('menu_item', $menu->id()),
  69. + );
  70. + }
  71. +
  72. return $form;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement