From 2f6650757afcc2b5d8f7707ced8122144d6b0db4 Mon Sep 17 00:00:00 2001 From: Brian Canini <canini.16@osu.edu> Date: Mon, 14 Jun 2021 10:57:21 -0400 Subject: [PATCH] Upgrading drupal/superfish (1.2.0 => 1.4.0) --- composer.json | 2 +- composer.lock | 70 +++++----- vendor/composer/InstalledVersions.php | 52 +++----- vendor/composer/include_paths.php | 2 +- vendor/composer/installed.json | 82 ++++++------ vendor/composer/installed.php | 34 ++--- vendor/symfony/css-selector/README.md | 10 +- vendor/symfony/finder/README.md | 10 +- vendor/symfony/polyfill-php80/composer.json | 2 +- vendor/symfony/var-dumper/README.md | 10 +- web/modules/superfish/README.txt | 123 +++++++++--------- web/modules/superfish/composer.json | 2 +- .../src/Plugin/Block/SuperfishBlock.php | 25 +++- web/modules/superfish/superfish.info.yml | 10 +- web/modules/superfish/superfish.install | 42 ++++-- web/modules/superfish/superfish.module | 52 ++++++-- web/modules/superfish/superfish.theme.inc | 56 ++++++-- .../templates/superfish-menu-items.html.twig | 31 +++-- 18 files changed, 347 insertions(+), 268 deletions(-) diff --git a/composer.json b/composer.json index 536b0f6419..bbc3fc9e4f 100644 --- a/composer.json +++ b/composer.json @@ -162,7 +162,7 @@ "drupal/smtp": "1.0", "drupal/social_media": "1.9-rc2", "drupal/social_media_links": "^2.8", - "drupal/superfish": "1.2", + "drupal/superfish": "1.4", "drupal/svg_image": "1.14", "drupal/token": "1.9", "drupal/twig_tweak": "2.9", diff --git a/composer.lock b/composer.lock index bf982b2c49..180450240e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "571e9b1a76aeda80996efade04968451", + "content-hash": "d3cd96c3df9f39031d74be176705f95b", "packages": [ { "name": "alchemy/zippy", @@ -7485,27 +7485,27 @@ }, { "name": "drupal/superfish", - "version": "1.2.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/superfish.git", - "reference": "8.x-1.2" + "reference": "8.x-1.4" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/superfish-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "e6f11be2bb2b95957d144bb0155c29c7aad40a62" + "url": "https://ftp.drupal.org/files/projects/superfish-8.x-1.4.zip", + "reference": "8.x-1.4", + "shasum": "d84b900e81c412ef783094a8ef51a79038d24a59" }, "require": { - "drupal/core": "~8.0", + "drupal/core": "^8 || ^9", "mehrpadin/superfish": "~2.0" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1544460480", + "version": "8.x-1.4", + "datestamp": "1590438116", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7514,7 +7514,7 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -12942,16 +12942,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.4.24", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "947cacaf1b3a2af6f13a435392873d5ddaba5f70" + "reference": "c1e29de6dc893b130b45d20d8051efbb040560a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/947cacaf1b3a2af6f13a435392873d5ddaba5f70", - "reference": "947cacaf1b3a2af6f13a435392873d5ddaba5f70", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c1e29de6dc893b130b45d20d8051efbb040560a9", + "reference": "c1e29de6dc893b130b45d20d8051efbb040560a9", "shasum": "" }, "require": { @@ -12987,7 +12987,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v4.4.24" + "source": "https://github.com/symfony/css-selector/tree/v4.4.25" }, "funding": [ { @@ -13003,7 +13003,7 @@ "type": "tidelift" } ], - "time": "2021-05-16T09:52:47+00:00" + "time": "2021-05-26T17:39:37+00:00" }, { "name": "symfony/debug", @@ -13370,16 +13370,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.24", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983" + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a96bc19ed87c88eec78e1a4c803bdc1446952983", - "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983", + "url": "https://api.github.com/repos/symfony/finder/zipball/ed33314396d968a8936c95f5bd1b88bd3b3e94a3", + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3", "shasum": "" }, "require": { @@ -13411,7 +13411,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.24" + "source": "https://github.com/symfony/finder/tree/v4.4.25" }, "funding": [ { @@ -13427,7 +13427,7 @@ "type": "tidelift" } ], - "time": "2021-05-16T12:27:45+00:00" + "time": "2021-05-26T11:20:16+00:00" }, { "name": "symfony/http-foundation", @@ -14136,16 +14136,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { @@ -14154,7 +14154,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -14199,7 +14199,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -14215,7 +14215,7 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-util", @@ -14800,16 +14800,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.22", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7" + "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c194bcedde6295f3ec3e9eba1f5d484ea97c41a7", - "reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", "shasum": "" }, "require": { @@ -14869,7 +14869,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.22" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" }, "funding": [ { @@ -14885,7 +14885,7 @@ "type": "tidelift" } ], - "time": "2021-04-19T13:36:17+00:00" + "time": "2021-05-27T09:48:32+00:00" }, { "name": "symfony/yaml", diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index ec11f0865e..da081d9c7b 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -20,8 +20,6 @@ - - class InstalledVersions { private static $installed = array ( @@ -32,7 +30,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => 'f486ac3a766c1d7362424bf27ea3e095e01700ae', + 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -1801,12 +1799,12 @@ class InstalledVersions ), 'drupal/superfish' => array ( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', 'aliases' => array ( ), - 'reference' => '8.x-1.2', + 'reference' => '8.x-1.4', ), 'drupal/svg_image' => array ( @@ -2289,7 +2287,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => 'f486ac3a766c1d7362424bf27ea3e095e01700ae', + 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', ), 'pantheon-systems/quicksilver-pushback' => array ( @@ -2804,12 +2802,12 @@ class InstalledVersions ), 'symfony/css-selector' => array ( - 'pretty_version' => 'v4.4.24', - 'version' => '4.4.24.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => '947cacaf1b3a2af6f13a435392873d5ddaba5f70', + 'reference' => 'c1e29de6dc893b130b45d20d8051efbb040560a9', ), 'symfony/debug' => array ( @@ -2858,12 +2856,12 @@ class InstalledVersions ), 'symfony/finder' => array ( - 'pretty_version' => 'v4.4.24', - 'version' => '4.4.24.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => 'a96bc19ed87c88eec78e1a4c803bdc1446952983', + 'reference' => 'ed33314396d968a8936c95f5bd1b88bd3b3e94a3', ), 'symfony/http-foundation' => array ( @@ -2948,12 +2946,12 @@ class InstalledVersions ), 'symfony/polyfill-php80' => array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', 'aliases' => array ( ), - 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', + 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', ), 'symfony/polyfill-util' => array ( @@ -3020,12 +3018,12 @@ class InstalledVersions ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.22', - 'version' => '4.4.22.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => 'c194bcedde6295f3ec3e9eba1f5d484ea97c41a7', + 'reference' => '31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0', ), 'symfony/yaml' => array ( @@ -3145,6 +3143,7 @@ public static function getInstalledPackages() $packages[] = array_keys($installed['versions']); } + if (1 === \count($packages)) { return $packages[0]; } @@ -3308,11 +3307,8 @@ public static function getRootPackage() - public static function getRawData() { -@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - return self::$installed; } @@ -3322,17 +3318,6 @@ public static function getRawData() -public static function getAllRawData() -{ -return self::getInstalled(); -} - - - - - - - @@ -3354,7 +3339,6 @@ public static function reload($data) - private static function getInstalled() { if (null === self::$canGetVendors) { diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php index 507c1ade7e..d4fb967181 100644 --- a/vendor/composer/include_paths.php +++ b/vendor/composer/include_paths.php @@ -6,8 +6,8 @@ $baseDir = dirname($vendorDir); return array( + $vendorDir . '/pear/archive_tar', $vendorDir . '/pear/console_getopt', $vendorDir . '/pear/pear-core-minimal/src', $vendorDir . '/pear/pear_exception', - $vendorDir . '/pear/archive_tar', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 22e8184c29..9e7fff9f39 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -7745,28 +7745,28 @@ }, { "name": "drupal/superfish", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.4.0", + "version_normalized": "1.4.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/superfish.git", - "reference": "8.x-1.2" + "reference": "8.x-1.4" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/superfish-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "e6f11be2bb2b95957d144bb0155c29c7aad40a62" + "url": "https://ftp.drupal.org/files/projects/superfish-8.x-1.4.zip", + "reference": "8.x-1.4", + "shasum": "d84b900e81c412ef783094a8ef51a79038d24a59" }, "require": { - "drupal/core": "~8.0", + "drupal/core": "^8 || ^9", "mehrpadin/superfish": "~2.0" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1544460480", + "version": "8.x-1.4", + "datestamp": "1590438116", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7776,7 +7776,7 @@ "installation-source": "dist", "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -11721,6 +11721,10 @@ "authyubikey", "simplesamlphp" ], + "support": { + "issues": "https://github.com/tvdijen/simplesamlphp-module-authyubikey/issues", + "source": "https://github.com/tvdijen/simplesamlphp-module-authyubikey" + }, "install-path": "../simplesamlphp/simplesamlphp/modules/authYubikey" }, { @@ -13155,23 +13159,23 @@ }, { "name": "symfony/css-selector", - "version": "v4.4.24", - "version_normalized": "4.4.24.0", + "version": "v4.4.25", + "version_normalized": "4.4.25.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "947cacaf1b3a2af6f13a435392873d5ddaba5f70" + "reference": "c1e29de6dc893b130b45d20d8051efbb040560a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/947cacaf1b3a2af6f13a435392873d5ddaba5f70", - "reference": "947cacaf1b3a2af6f13a435392873d5ddaba5f70", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c1e29de6dc893b130b45d20d8051efbb040560a9", + "reference": "c1e29de6dc893b130b45d20d8051efbb040560a9", "shasum": "" }, "require": { "php": ">=7.1.3" }, - "time": "2021-05-16T09:52:47+00:00", + "time": "2021-05-26T17:39:37+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -13203,7 +13207,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v4.4.24" + "source": "https://github.com/symfony/css-selector/tree/v4.4.25" }, "funding": [ { @@ -13547,23 +13551,23 @@ }, { "name": "symfony/finder", - "version": "v4.4.24", - "version_normalized": "4.4.24.0", + "version": "v4.4.25", + "version_normalized": "4.4.25.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983" + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a96bc19ed87c88eec78e1a4c803bdc1446952983", - "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983", + "url": "https://api.github.com/repos/symfony/finder/zipball/ed33314396d968a8936c95f5bd1b88bd3b3e94a3", + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3", "shasum": "" }, "require": { "php": ">=7.1.3" }, - "time": "2021-05-16T12:27:45+00:00", + "time": "2021-05-26T11:20:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -13591,7 +13595,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.24" + "source": "https://github.com/symfony/finder/tree/v4.4.25" }, "funding": [ { @@ -14190,27 +14194,27 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", + "version": "v1.23.0", + "version_normalized": "1.23.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-01-07T16:49:33+00:00", + "time": "2021-02-19T12:13:01+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -14256,7 +14260,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -14772,17 +14776,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.22", - "version_normalized": "4.4.22.0", + "version": "v4.4.25", + "version_normalized": "4.4.25.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7" + "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c194bcedde6295f3ec3e9eba1f5d484ea97c41a7", - "reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", "shasum": "" }, "require": { @@ -14806,7 +14810,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-04-19T13:36:17+00:00", + "time": "2021-05-27T09:48:32+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -14844,7 +14848,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.22" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a81a6cc59a..fa4f421335 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => 'f486ac3a766c1d7362424bf27ea3e095e01700ae', + 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -1775,12 +1775,12 @@ ), 'drupal/superfish' => array ( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', 'aliases' => array ( ), - 'reference' => '8.x-1.2', + 'reference' => '8.x-1.4', ), 'drupal/svg_image' => array ( @@ -2263,7 +2263,7 @@ 'aliases' => array ( ), - 'reference' => 'f486ac3a766c1d7362424bf27ea3e095e01700ae', + 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', ), 'pantheon-systems/quicksilver-pushback' => array ( @@ -2778,12 +2778,12 @@ ), 'symfony/css-selector' => array ( - 'pretty_version' => 'v4.4.24', - 'version' => '4.4.24.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => '947cacaf1b3a2af6f13a435392873d5ddaba5f70', + 'reference' => 'c1e29de6dc893b130b45d20d8051efbb040560a9', ), 'symfony/debug' => array ( @@ -2832,12 +2832,12 @@ ), 'symfony/finder' => array ( - 'pretty_version' => 'v4.4.24', - 'version' => '4.4.24.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => 'a96bc19ed87c88eec78e1a4c803bdc1446952983', + 'reference' => 'ed33314396d968a8936c95f5bd1b88bd3b3e94a3', ), 'symfony/http-foundation' => array ( @@ -2922,12 +2922,12 @@ ), 'symfony/polyfill-php80' => array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', 'aliases' => array ( ), - 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', + 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', ), 'symfony/polyfill-util' => array ( @@ -2994,12 +2994,12 @@ ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.22', - 'version' => '4.4.22.0', + 'pretty_version' => 'v4.4.25', + 'version' => '4.4.25.0', 'aliases' => array ( ), - 'reference' => 'c194bcedde6295f3ec3e9eba1f5d484ea97c41a7', + 'reference' => '31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0', ), 'symfony/yaml' => array ( diff --git a/vendor/symfony/css-selector/README.md b/vendor/symfony/css-selector/README.md index 7c4c411635..ede4a3acc3 100644 --- a/vendor/symfony/css-selector/README.md +++ b/vendor/symfony/css-selector/README.md @@ -6,11 +6,11 @@ The CssSelector component converts CSS selectors to XPath expressions. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/css_selector.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/css_selector.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) Credits ------- diff --git a/vendor/symfony/finder/README.md b/vendor/symfony/finder/README.md index 0b19c75257..22bdeb9bcf 100644 --- a/vendor/symfony/finder/README.md +++ b/vendor/symfony/finder/README.md @@ -7,8 +7,8 @@ interface. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/finder.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json index a9e6813c97..5fe679db39 100644 --- a/vendor/symfony/polyfill-php80/composer.json +++ b/vendor/symfony/polyfill-php80/composer.json @@ -30,7 +30,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/vendor/symfony/var-dumper/README.md b/vendor/symfony/var-dumper/README.md index 339f73eba3..bdac24477a 100644 --- a/vendor/symfony/var-dumper/README.md +++ b/vendor/symfony/var-dumper/README.md @@ -8,8 +8,8 @@ of `var_dump`. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/web/modules/superfish/README.txt b/web/modules/superfish/README.txt index 2860216861..9d682131ef 100644 --- a/web/modules/superfish/README.txt +++ b/web/modules/superfish/README.txt @@ -1,80 +1,79 @@ -Superfish module +CONTENTS OF THIS FILE +--------------------- -About ------ -This module allows for integration of jQuery Superfish plug-in with Drupal CMS. - - -Requirement ------------ -- Superfish library. - Link: https://github.com/mehrpadin/Superfish-for-Drupal/ + * Introduction + * Requirements + * Recommended Modules + * Installation + * Configuration + * Maintainers -Installation instructions (composer) ------------------------------------- -0. You can skip this step if you use the popular - https://github.com/drupal-composer/drupal-project. - Otherwise check that your composer.json file has directives to install - libraries in the libraries directory like this: - - "require": { - "composer/installers": "^1.0", - }, - "extra": { - "installer-paths": { - "web/libraries/{$name}": ["type:drupal-library"] - } - } - - This assumes that your drupal root resides in the "web" direectory. - If it is in another directory (e.g. "docroot"), change accordingly. +INTRODUCTION +------------ -1. Require the module +This module allows for integration of jQuery Superfish plug-in with Drupal CMS. - $ composer require drupal/superfish + * For a full description of the module, visit the project page: + https://www.drupal.org/project/superfish - Composer will then put the module *and* its library into the right places. + * To submit bug reports and feature suggestions, or to track changes: + https://www.drupal.org/project/issues/superfish -2. Go to "Administer" -> "Modules" and enable the module. -3. Go to "Administer" -> "Structure" -> "Block layout" -> click a "Place block" - button to add a Superfish block to a region. +REQUIREMENTS +------------ +This module requires the following outside of Drupal core: -Installation instructions (manual) ----------------------------------- -1. Download and extract the Superfish library into the libraries directory - (usually "DRUPAL_ROOT/libraries"). - Link: https://github.com/mehrpadin/Superfish-for-Drupal/zipball/2.x + * Superfish library - https://github.com/mehrpadin/Superfish-for-Drupal/ -2. Download and extract the Superfish module into the modules directory - (usually "DRUPAL_ROOT/modules"). - Link: http://drupal.org/project/superfish -3. Go to "Administer" -> "Modules" and enable the module. +RECOMMENDED MODULES +------------------- -4. Go to "Administer" -> "Structure" -> "Block layout" -> click a "Place block" - button to add a Superfish block to a region. + * Libraries API - https://www.drupal.org/project/libraries + * jQuery Easing plugin - https://www.drupal.org/project/jqeasing -How to style +INSTALLATION ------------ -Here are some tips and tricks: - -A) Utilise the "Default" style as reference. - -B) Always use a DOM inspector utility (such as Firebug). - -C) Set the "Menu delay" option in the block configuration to a very high number - such as 99999999 while creating your own CSS. This will give you enough time - to work with sub-menus. - -C) If your theme supports the Superfish module, set the "Style" option in the - block configuration to "None". - + * Install the Superfish module as you would normally install a contributed + Drupal module. Visit + https://www.drupal.org/node/1897420 for further information. + + +CONFIGURATION +------------- + + 1. Navigate to Administration > Extend and enable the module. + 2. Go to Administation > Structure > Block layout > select a Place block + button to add a Superfish block to a region. + 3. Use the "Configure" link of the block to configure it accordingly to your + needs. + +How to style: + 1. In the block configuration page, set the Style to None + 2. Copy one of the Superfish sample styles, for example default.css from + sites/all/libraries/superfish/style to your theme; either as a separate + CSS file or part of the main CSS file of your theme. + 3. Rename the selectors .sf-style-default to .sf-style-none or remove + them altogether. + 4. You are now ready to unleash your CSS artistry :) + +Some design tips: + * Utilize a DOM inspector (such as Firefox Developer Tools) for temporarily + modifying live code in real time. + * Set the Mouse delay of the block settings to 99999999 so the sub-menus will + stay open for a longer time giving you more time to work with them in the + DOM inspector etc. + Useful links: + https://docs.acquia.com/resource/browser-tool/ + https://www.drupal.org/node/147789#web-browser-tools + + +MAINTAINERS +----------- -Support requests ----------------- -You can request support here: http://drupal.org/project/issues/superfish + * mehrpadin - https://www.drupal.org/u/mehrpadin diff --git a/web/modules/superfish/composer.json b/web/modules/superfish/composer.json index 3f2f7ab1ca..96d058a897 100644 --- a/web/modules/superfish/composer.json +++ b/web/modules/superfish/composer.json @@ -14,7 +14,7 @@ "issues": "https://www.drupal.org/project/superfish", "source": "https://cgit.drupalcode.org/superfish" }, - "license": "GPL-2.0+", + "license": "GPL-2.0-or-later", "require": { "mehrpadin/superfish": "~2.0" } diff --git a/web/modules/superfish/src/Plugin/Block/SuperfishBlock.php b/web/modules/superfish/src/Plugin/Block/SuperfishBlock.php index da21cfaf3d..15b3ad2382 100644 --- a/web/modules/superfish/src/Plugin/Block/SuperfishBlock.php +++ b/web/modules/superfish/src/Plugin/Block/SuperfishBlock.php @@ -44,7 +44,7 @@ class SuperfishBlock extends SystemMenuBlock { * @param \Drupal\Core\Menu\MenuActiveTrailInterface $menu_active_trail * The active menu trail service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail) { parent::__construct($configuration, $plugin_id, $plugin_definition, $menu_tree, $menu_active_trail); $this->menuActiveTrail = $menu_active_trail; } @@ -1219,7 +1219,7 @@ public function build() { else { $sfoptions['disableHI'] = TRUE; } - $sfoptions = sf_array_filter($sfoptions); + $sfoptions = superfish_array_filter($sfoptions); // Options for Superfish sub-plugins. $sfplugins = []; @@ -1475,7 +1475,7 @@ public function build() { } $sfplugins['smallscreen']['title'] = $title ? $title : $this->label(); } - $sfplugins = sf_array_filter($sfplugins); + $sfplugins = superfish_array_filter($sfplugins); // Menu block ID. $menu_name = $this->getDerivativeId(); @@ -1504,6 +1504,25 @@ public function build() { ->setActiveTrail($this->menuActiveTrail->getActiveTrailIds($menu_name)) ->onlyEnabledLinks(); + // For menu blocks with start level greater than 1, only show menu items + // from the current active trail. Adjust the root according to the current + // position in the menu in order to determine if we can show the subtree. + if ($level > 1) { + if (count($parameters->activeTrail) >= $level) { + // Active trail array is child-first. Reverse it, and pull the new menu + // root based on the parent of the configured start level. + $menu_trail_ids = array_reverse(array_values($parameters->activeTrail)); + $menu_root = $menu_trail_ids[$level - 1]; + $parameters->setRoot($menu_root)->setMinDepth(1); + if ($depth > 0) { + $parameters->setMaxDepth(min($level - 1 + $depth - 1, $this->menuTree->maxDepth())); + } + } + else { + return []; + } + } + $tree = $this->menuTree->load($menu_name, $parameters); $manipulators = [ ['callable' => 'menu.default_tree_manipulators:checkAccess'], diff --git a/web/modules/superfish/superfish.info.yml b/web/modules/superfish/superfish.info.yml index ef14b96ee2..d8b107eb52 100644 --- a/web/modules/superfish/superfish.info.yml +++ b/web/modules/superfish/superfish.info.yml @@ -2,10 +2,10 @@ name: 'Superfish' type: module description: 'Adds jQuery Superfish plugin to menu blocks.' package: User interface -# core: 8.x +core: 8.x +core_version_requirement: ^8 || ^9 -# Information added by Drupal.org packaging script on 2018-02-04 -version: '8.x-1.2' -core: '8.x' +# Information added by Drupal.org packaging script on 2020-05-25 +version: '8.x-1.4' project: 'superfish' -datestamp: 1517739484 +datestamp: 1590438118 diff --git a/web/modules/superfish/superfish.install b/web/modules/superfish/superfish.install index 4e85260f31..87594b0692 100644 --- a/web/modules/superfish/superfish.install +++ b/web/modules/superfish/superfish.install @@ -9,13 +9,14 @@ * Implements hook_enable(). */ function superfish_install() { + $messenger = \Drupal::messenger(); if (superfish_library_check()) { - drupal_set_message(t('In order to use Superfish, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', ['@block' => 'structure/block'])); + $messenger->addMessage(t('In order to use Superfish, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', ['@block' => 'structure/block'])); } else { - drupal_set_message(t('Superfish library is missing. Please refer to the <a href="@documentation">plugin documentation</a> for how you can fix this issue; Once done, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', ['@documentation' => 'http://drupal.org/node/1125896', '@block' => 'structure/block']), 'warning'); + $messenger->addWarning(t('Superfish library is missing. Please refer to the <a href="@documentation">plugin documentation</a> for how you can fix this issue; Once done, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', ['@documentation' => 'https://www.drupal.org/node/1125896', '@block' => 'structure/block'])); } - drupal_set_message(t('If there was no Superfish block in the "Place block" form, go to the <a href="@performance">Performance</a> page and clear the cache once.', ['@performance' => 'admin/config/development/performance'])); + $messenger->addMessage(t('If there was no Superfish block in the "Place block" form, go to the <a href="@performance">Performance</a> page and clear the cache once.', ['@performance' => 'config/development/performance'])); } /** @@ -27,20 +28,35 @@ function superfish_requirements($phase) { $requirements['superfish']['title'] = t('Superfish library'); if (superfish_library_check()) { - $requirements['superfish']['value'] = t('Installed; at @location', ['@location' => superfish_library_path()]); - $requirements['superfish']['severity'] = REQUIREMENT_OK; + // Check the uploaded Superfish library version. + $version = superfish_library_version(); + if (is_null($version)) { + $requirements['superfish']['value'] = t('Inaccessible'); + $requirements['superfish']['severity'] = REQUIREMENT_ERROR; + $requirements['superfish']['description'] = t('Cannot access the Superfish library directory; perhaps because its permissions and/or ownership are not set up correctly.'); + } + else { + $version = (integer) $version; + if (!$version || !is_numeric($version)) { + $requirements['superfish']['value'] = t('Unknown version'); + $requirements['superfish']['severity'] = REQUIREMENT_ERROR; + $requirements['superfish']['description'] = t('Cannot determine the version of your Superfish library.'); + } + elseif (version_compare($version, 2, '<')) { + $requirements['superfish']['value'] = t('Not supported'); + $requirements['superfish']['severity'] = REQUIREMENT_ERROR; + $requirements['superfish']['description'] = t('The Superfish library requires an update. You can find the update instructions on :url.', [':url' => 'https://www.drupal.org/project/superfish']); + } + else { + $requirements['superfish']['value'] = t('Installed; at @location', ['@location' => superfish_library_path()]); + $requirements['superfish']['severity'] = REQUIREMENT_OK; + } + } } else { $requirements['superfish']['value'] = t('Not installed'); $requirements['superfish']['severity'] = REQUIREMENT_ERROR; - $requirements['superfish']['description'] = t('Please download the Superfish library from :url.', [':url' => 'http://drupal.org/project/superfish']); - } - - // Check the uploaded Superfish library version. - if (($version = superfish_library_version()) && $version != '2.0') { - $requirements['superfish']['value'] = t('Not supported'); - $requirements['superfish']['severity'] = REQUIREMENT_ERROR; - $requirements['superfish']['description'] = t('The Superfish library requires an update. You can find the update instructions on :url.', [':url' => 'http://drupal.org/project/superfish']); + $requirements['superfish']['description'] = t('Please download the Superfish library from :url.', [':url' => 'https://www.drupal.org/project/superfish']); } } return $requirements; diff --git a/web/modules/superfish/superfish.module b/web/modules/superfish/superfish.module index 4151c053ef..b49ef31360 100644 --- a/web/modules/superfish/superfish.module +++ b/web/modules/superfish/superfish.module @@ -24,7 +24,7 @@ function superfish_block_view_superfish_alter(array &$build, BlockPluginInterfac function superfish_libraries_info() { $libraries['superfish'] = [ 'name' => 'superfish', - 'vendor url' => 'http://github.com/mehrpadin/Superfish-for-Drupal', + 'vendor url' => 'https://github.com/mehrpadin/Superfish-for-Drupal', 'download url' => 'https://github.com/mehrpadin/Superfish-for-Drupal/zipball/2.x', 'version callback' => 'superfish_library_version', 'files' => [ @@ -58,7 +58,7 @@ function superfish_library_info_build() { $superfish_library_path = '/' . $superfish_library_path; $libraries = [ 'superfish' => [ - 'remote' => 'http://github.com/mehrpadin/Superfish-for-Drupal', + 'remote' => 'https://github.com/mehrpadin/Superfish-for-Drupal', 'version' => '2.0', 'license' => [ 'name' => 'MIT', @@ -197,12 +197,33 @@ function superfish_library_info_build() { function superfish_library_path($library = 'superfish') { $directory = FALSE; // Ensure the Libraries API module is installed and working. - if (function_exists('libraries_get_path') && ($directory = libraries_get_path($library))) { - return $directory; + if (function_exists('libraries_get_path')) { + $directory = libraries_get_path($library); + if ($directory) { + return $directory; + } + elseif (ucfirst($library) !== $library) { + $directory = libraries_get_path(ucfirst($library)); + if ($directory) { + return $directory; + } + } } // Otherwise use the default directory. - if (file_exists('profiles/' . drupal_get_profile() . '/libraries/' . $library)) { - $directory = 'profiles/' . drupal_get_profile() . '/libraries/' . $library; + if (\Drupal::hasContainer()) { + $profile = \Drupal::installProfile(); + } + else { + $profile = BootstrapConfigStorageFactory::getDatabaseStorage()->read('core.extension')['profile']; + } + if (file_exists('profiles/' . $profile . '/libraries/' . $library)) { + $directory = 'profiles/' . $profile . '/libraries/' . $library; + } + elseif (file_exists('profiles/contrib/' . $profile . '/libraries/' . $library)) { + $directory = 'profiles/contrib/' . $profile . '/libraries/' . $library; + } + elseif (file_exists('profiles/custom/' . $profile . '/libraries/' . $library)) { + $directory = 'profiles/custom/' . $profile . '/libraries/' . $library; } elseif (file_exists('libraries/' . $library)) { $directory = 'libraries/' . $library; @@ -213,6 +234,9 @@ function superfish_library_path($library = 'superfish') { elseif (file_exists('sites/default/libraries/' . $library)) { $directory = 'sites/default/libraries/' . $library; } + if (!$directory && ucfirst($library) !== $library) { + $directory = superfish_library_path(ucfirst($library)); + } return $directory; } @@ -222,12 +246,15 @@ function superfish_library_path($library = 'superfish') { function superfish_library_check() { if (function_exists('libraries_get_libraries')) { $library = libraries_get_libraries(); - if (isset($library['superfish'])) { + if (isset($library['superfish']) || isset($library['Superfish'])) { return TRUE; } } - elseif (($directory = superfish_library_path()) && file_exists($directory . '/superfish.js')) { - return TRUE; + else { + $directory = superfish_library_path(); + if ($directory && file_exists($directory . '/superfish.js')) { + return TRUE; + } } return FALSE; } @@ -239,6 +266,9 @@ function superfish_library_version() { // Get the library version. if (($directory = superfish_library_path()) && file_exists($directory . '/VERSION')) { $version = file_get_contents($directory . '/VERSION'); + if ($version === FALSE) { + return NULL; + } // Removing blank lines and white spaces. $version = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", trim($version)); if (!empty($version)) { @@ -301,10 +331,10 @@ function superfish_effects() { /** * Helper function to clean up arrays. */ -function sf_array_filter($haystack) { +function superfish_array_filter($haystack) { foreach ($haystack as $key => $value) { if (is_array($value)) { - $haystack[$key] = sf_array_filter($haystack[$key]); + $haystack[$key] = superfish_array_filter($haystack[$key]); } elseif (empty($value) && is_bool($value) !== TRUE) { if ($haystack[$key] != '0') { diff --git a/web/modules/superfish/superfish.theme.inc b/web/modules/superfish/superfish.theme.inc index 8bc6cb8041..079b3d1a42 100644 --- a/web/modules/superfish/superfish.theme.inc +++ b/web/modules/superfish/superfish.theme.inc @@ -9,7 +9,8 @@ use Drupal\Core\Menu\InaccessibleMenuLink; use Drupal\Core\Language\LanguageInterface; use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\SafeMarkup; +use Drupal\Component\Render\FormattableMarkup; +use Drupal\Core\Template\Attribute; /** * Prepares variables for the Superfish menu template. @@ -54,7 +55,7 @@ function template_preprocess_superfish(array &$variables) { else { $menu_classes[] = Html::cleanCssIdentifier($element['#settings']['ulclass']); } - $menu_classes = implode(' ', sf_array_filter($menu_classes)); + $menu_classes = implode(' ', superfish_array_filter($menu_classes)); $variables['id'] = $element['#html_id']; $variables['menu_classes'] = $menu_classes; @@ -100,13 +101,13 @@ function template_preprocess_superfish_menu_items(array &$variables) { $active_trails = \Drupal::service('menu.active_trail') ->getActiveTrailIds($element['#menu_name']); - foreach ($menu as $key => $menu_item) { + foreach ($menu as $menu_item) { if (NULL !== $menu_item->link && !($menu_item->link instanceof InaccessibleMenuLink)) { $item_class = $link_class = []; - $multicolumn_wrapper = $multicolumn_column = $multicolumn_content = FALSE; + $multicolumn_wrapper = $multicolumn_column = $multicolumn_content = $nolink = FALSE; // Menu link properties. $link = $menu_item->link->getPluginDefinition(); @@ -125,17 +126,24 @@ function template_preprocess_superfish_menu_items(array &$variables) { 'inActiveTrail' => $menu_item->inActiveTrail, ]; - if ($menu_item->link->getUrlObject()->isRouted()) { + if ($item['url']->isRouted()) { // Adding the "is-active" class. $host = \Drupal::request()->getHttpHost(); $request_uri = \Drupal::request()->getRequestUri(); $current_url = Url::fromRoute('<current>'); $current_path = $current_url->toString(); $link_url = $item['url']->toString(); + // Anchor links. + if (strpos($link_url, '#') !== FALSE) { + $link_url = explode('#', $link_url); + $link_url = $link_url[0]; + } + if ($link_url == $current_path || $link_url == $request_uri || $link_url == $host . $request_uri) { $link_class[] = 'is-active'; } + $nolink = $item['url']->getRouteName() === '<nolink>' ? TRUE : FALSE; } // Adding the necessary "active-trail" class. @@ -228,7 +236,7 @@ function template_preprocess_superfish_menu_items(array &$variables) { // sfTouchscreen. // Preparing the cloned parent links to be added to the sub-menus. - if ($settings['clone_parent'] && $item['subtree']) { + if ($settings['clone_parent'] && $item['subtree'] && !$nolink) { $cloned_parent = $menu_item; $cloned_parent->subtree = []; } @@ -257,7 +265,7 @@ function template_preprocess_superfish_menu_items(array &$variables) { } // Preparing <li> classes for the theme. - $item_class = implode(' ', sf_array_filter($item_class)); + $item_class = implode(' ', superfish_array_filter($item_class)); // Merging link classes. if (isset($item['options']['attributes']['class'])) { @@ -267,31 +275,51 @@ function template_preprocess_superfish_menu_items(array &$variables) { } $link_class = array_merge( $link_class_current, - sf_array_filter($link_class) + superfish_array_filter($link_class) ); } - $item['options']['attributes']['class'] = sf_array_filter($link_class); + $item['options']['attributes']['class'] = superfish_array_filter($link_class); // Dirty fix! to only add a "menuparent" class. $item['options_menuparent'] = $item['options']; $item['options_menuparent']['attributes']['class'][] = 'menuparent'; + if ($nolink) { + $item['options_menuparent']['attributes']['class'][] = 'nolink'; + } $link_element = [ '#type' => 'link', - '#title' => SafeMarkup::format($link_text, $link_text_replace), + '#title' => new FormattableMarkup($link_text, $link_text_replace), '#url' => $item['url'], '#options' => $item['options'], ]; $link_element_menuparent = [ '#type' => 'link', - '#title' => SafeMarkup::format($link_text, $link_text_replace), + '#title' => new FormattableMarkup($link_text, $link_text_replace), '#url' => $item['url'], '#options' => $item['options_menuparent'], ]; - $id = $element['#menu_name'] . '-' . $item['id']; + $item_attributes = new Attribute(); + if (isset($item['options']['item_attributes'])) { + foreach ($item['options']['item_attributes'] as $name => $value) { + $value = trim($value); + if ($value) { + $item_attributes->offsetSet($name, $value); + } + } + } + + $id = Html::getUniqueId($element['#menu_name'] . '-' . $item['id']); + if (!$item_attributes->offsetGet('id')) { + $item_attributes->offsetSet('id', $id); + } + + if ($item_class) { + $item_attributes->offsetSet('class', trim($item_attributes->offsetGet('class') . ' ' . $item_class)); + } + $variables['menu_items'][] = [ - 'id' => Html::getUniqueId($id), - 'item_class' => $item_class, + 'attributes' => $item_attributes, 'link' => $link_element, 'link_menuparent' => $link_element_menuparent, 'children' => $children, diff --git a/web/modules/superfish/templates/superfish-menu-items.html.twig b/web/modules/superfish/templates/superfish-menu-items.html.twig index 88eb32f05b..f396137f95 100644 --- a/web/modules/superfish/templates/superfish-menu-items.html.twig +++ b/web/modules/superfish/templates/superfish-menu-items.html.twig @@ -23,33 +23,32 @@ {% spaceless %} {% for item in menu_items %} - {% if item['children'] is not empty %} + {% if item.children is not empty %} {% set item_class = item.item_class ~ ' menuparent' %} - {% if item['multicolumn_column'] %} + {% if item.multicolumn_column %} {% set item_class = item_class ~ ' sf-multicolumn-column' %} {% endif %} {% endif %} - <li id="{{ item.id }}" - {% if item['item_class'] %} class="{{ item['item_class'] }}"{% endif %}> - {% if item['multicolumn_column'] %} + <li{{ item.attributes }}> + {% if item.multicolumn_column %} <div class="sf-multicolumn-column"> {% endif %} - {% if item['children'] is not empty %} - {{ item['link_menuparent'] }} + {% if item.children is not empty %} + {{ item.link_menuparent }} {% else %} - {{ item['link'] }} + {{ item.link }} {% endif %} - {% if item['multicolumn_wrapper'] %}<ul class="sf-multicolumn"> - <li class="sf-multicolumn-wrapper {{ item['item_class'] }}"> + {% if item.multicolumn_wrapper %}<ul class="sf-multicolumn"> + <li class="sf-multicolumn-wrapper {{ item.item_class }}"> {% endif %} - {% if item['children'] is not empty %} - {% if item['multicolumn_content'] %}<ol>{% else %}<ul>{% endif %} - {{ item['children'] }} - {% if item['multicolumn_content'] %}</ol>{% else %}</ul>{% endif %} + {% if item.children is not empty %} + {% if item.multicolumn_content %}<ol>{% else %}<ul>{% endif %} + {{ item.children }} + {% if item.multicolumn_content %}</ol>{% else %}</ul>{% endif %} {% endif %} - {% if item['multicolumn_wrapper'] %}</li></ul>{% endif %} - {% if item['multicolumn_column'] %}</div>{% endif %} + {% if item.multicolumn_wrapper %}</li></ul>{% endif %} + {% if item.multicolumn_column %}</div>{% endif %} </li> {% endfor %} -- GitLab